Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 PHP Coding Difficulties 2
Index -> Web Design
Goto page 1, 2, 3  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mario64mario




PostPosted: Tue Jul 22, 2008 12:12 pm   Post subject: PHP Coding Difficulties 2

I'm back, from the remains of 'PHP Coding Difficulties'. I've completely wiped out the ftp with the design I had, and re-wrote new and much more basic coding. ALAS, the site still remains the same. The background image covers the rest of the site. Here's all the code I have.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Style.css

body {
margin: 0px;
padding: 0px;
text-align: center;
}

td.menu {
border-width: 1px;
border-top: 0px;
border-style: solid;
border-color: #000;
}

td.content {
border-width: 1px;
border-top: 0px;
border-style: solid;
border-color: #000;
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Index.php

<?php include("layout/top.php"); ?>
Content
<?php include("layout/bottom.php"); ?>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Top.php (header)

<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
<title>Test Page
</head>
<body>
<img src=layout/banner.png><center>
<tr><td class=content>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bottom.php (footer)

</table>
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Can anyone help me with this?
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Tue Jul 22, 2008 2:37 pm   Post subject: RE:PHP Coding Difficulties 2

Well, you don't appear to have a <table> tag, nor do you appear to have </td> and </tr> tags. There is, technically, a <tbody></tbody> pair, but since most browsers let you ignore that, I'll ignore it too.

Again, try putting your code through the W3C validator, and using the <doctype .... > tag I mentioned in the other thread. This will force things to behave in a standards-compliant manner. (Oh, and for the sake of your own sanity, make sure you do everything in Firefox. IE is a nightmare.)

Kudos, though, the code you've posted now is WAY better than the code you had before. Leaps and bounds.
mario64mario




PostPosted: Tue Jul 22, 2008 2:51 pm   Post subject: Re: PHP Coding Difficulties 2

1. I've added the tags you've outline. Thanks.

2. I can't find the validator anywhere. Can you link me to it? Sorry... -___-

3. How do I use doctype again? ^__^''

4. Is Firefox going to help in coding issues, or the final result? 'Cause I'm stuck with IE until I get another computer, which won't be for at the very most 2 years.
octopi




PostPosted: Tue Jul 22, 2008 3:02 pm   Post subject: Re: PHP Coding Difficulties 2

You do know you can download and install firefox side by side with internet explorer right?

http://www.mozilla.com/en-US/firefox/
DemonWasp




PostPosted: Tue Jul 22, 2008 3:08 pm   Post subject: RE:PHP Coding Difficulties 2

1. No problem. If you install a better graphical editor, and be sure to indent properly, you'll discover things like that much faster. For a beginner, I would recommend Notepad++, but most professional programmers would reach for something like vim or emacs.

2. http://validator.w3.org/ , the free validation service. Note: if you make sure to include the DOCTYPE specified in #3, then this tool will be able to give you more information about how to fix your code.

3. Insert the following line as the first line of your top.php include:
code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


4. Firefox interprets HTML better than any version of IE, and it's MUCH better when dealing with CSS and any Javascript. It also has helpful plugins to help with web development, such as Firebug. If you need your site to be visible to people using IE, then you'll eventually have to make sure it works in IE (the biggest steps there are making sure it's 100% compliant - passes the validator with no errors) and in checking it yourself). Either way, it's easiest to develop in Firefox, then hack the result to work in IE.

May I ask why, of all reasons, you're stuck running IE and can't manage Firefox?
mario64mario




PostPosted: Tue Jul 22, 2008 4:50 pm   Post subject: Re: PHP Coding Difficulties 2

The admin of this CPU won't allow me to download another browser for the reason that programming is a 'hobby'. I'll probably get my own computer in a couple years for college or university, so I'll probably get it then.
Zeroth




PostPosted: Tue Jul 22, 2008 5:05 pm   Post subject: Re: PHP Coding Difficulties 2

mario64mario @ Tue Jul 22, 2008 1:50 pm wrote:
The admin of this CPU won't allow me to download another browser for the reason that programming is a 'hobby'. I'll probably get my own computer in a couple years for college or university, so I'll probably get it then.
... Gee, I suppose that the guys running Microsoft are doing it for a hobby? I bet this is your parents, not wanting you to download/install some random program. You should point them to this page showing that Firefox 3 was downloaded at least 8 million times in one day. http://www.spreadfirefox.com/en-US/worldrecord
mario64mario




PostPosted: Tue Jul 22, 2008 5:24 pm   Post subject: Re: PHP Coding Difficulties 2

Yea, they really wouldn't care. XD
Sponsor
Sponsor
Sponsor
sponsor
octopi




PostPosted: Tue Jul 22, 2008 7:22 pm   Post subject: Re: PHP Coding Difficulties 2

Never used it but check this out
http://portableapps.com/news/2008-07-21_-_firefox_portable_3.0.1
Apparently doesn't require you to install app, just run it.
mario64mario




PostPosted: Tue Jul 22, 2008 9:06 pm   Post subject: Re: PHP Coding Difficulties 2

So it stays on the USB key, and when you take the key out, the original browser is used as it were?
octopi




PostPosted: Tue Jul 22, 2008 9:08 pm   Post subject: Re: PHP Coding Difficulties 2

Yes, its just like a program you'd run, it runs off the usb key as far as I know, like I said I've never used it, you'll have to take a better look at the site and figure it out.
mario64mario




PostPosted: Tue Jul 22, 2008 9:11 pm   Post subject: Re: PHP Coding Difficulties 2

Alright, I'll look into it further. Thanks for the referal.
jeffgreco13




PostPosted: Wed Jul 23, 2008 8:49 am   Post subject: Re: PHP Coding Difficulties 2

That's pretty cool that firefox portable...

K but about your problem mario64... according to this NEW code u submitted there is not background image being loaded.

In your img and class make sure u sure quotation marks ( " ).

In the styles for td.menu and td.content, neither have a background image or colour specified. Meaning it will be transparents to the background image.

And let's get one thing straight, the background image is the BACKGROUND image so unless you're not making it a background image to your site,
IT IS NOT OVERLAPPING YOUR MATERIAL. You just might have colour conflicts (black on black).

I'm also pretty sure I told you to start practicing closing a tag AS SOON as you open it then write then content between them. This ensures you don't forget to close things like the </tr></tr></center> tags u missed.
mario64mario




PostPosted: Wed Jul 23, 2008 10:01 am   Post subject: Re: PHP Coding Difficulties 2

I'll have lots of time to practise that in September. I have computer science class, and we're using Turing. I think we might go into Java a bit as well.

I've erased the background image, and it no longer shows it. It only shows a blank page.

I think the file names of the images are corrupting the page. Would extension have an effect? Should I change them from PNG to JPEG?
DemonWasp




PostPosted: Wed Jul 23, 2008 12:38 pm   Post subject: RE:PHP Coding Difficulties 2

The extension of a file name is used for the sole purpose of discovering what kind of file it is (at least on Windows and largely on the Web). So: If you have not changed the type of contents in the file, do not change its extension.

Even if you were to change the .JPG on the end to .PNG, that wouldn't make it a PNG image - it'd make it a broken file, since trying to read JPG data as PNG doesn't work...at all.

I also have no idea what you mean by "file names of the images are corrupting the page", since that doesn't seem remotely possible.

Your page will display exactly as you tell it to. If you start talking gibberish at it, it will display gibberish. Check that your code is well-formatted (ie indent your code), then post it here, using < syntax="html" > < /syntax > around the whole thing. We will help you to make sure you're telling the computer exactly what you want.
Display posts from previous:   
   Index -> Web Design
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 3  [ 33 Posts ]
Goto page 1, 2, 3  Next
Jump to:   


Style:  
Search: