Jump to content

HTML to PHP problem


bmroyer

Recommended Posts

I'm in the process of converting my html website into a php website. The problem I'm having is the layout breaks when its php. I don't know how to explain it, I have the basic files, header, leftbar, rightbar, content, and footer. I cut them straight out of the html and put them into the php files with the exception of the index.php which has all the "include" commands.

You can view the site and probably the code with firefox.

 

http://brandonroyer.com/php_version/index.php

 

HTML version:

 

http://brandonroyer.com/test/

 

 

Link to comment
Share on other sites

Yes it's still broken, the HTML is not the same. You need to get the HTML to be the same, the browser doesn't care or know anything about PHP. PHP is not the problem, the problem is that the HTML you're outputting is not correct.

 

If I use the browser's developer tools to look at the DOM of the page, I can see that for the working version the body has a div inside it called wrapper. In order, inside wrapper are header, topmenu, leftbar, rightbar, content, sitemap, and footer. On the broken version, the wrapper div only contains header, topmenu, and leftbar. The other elements, rightbar, content, sitemap, and footer, are children of the leftbar div, not the wrapper div.

Link to comment
Share on other sites

Thanks, I see I cut off the left bar div before it ended. Seems to work now!

 

BTW, what are those little black question marks on the php version?

Edited by bmroyer
Link to comment
Share on other sites

The file might not be saved in the correct character encoding, it needs to be saved as a UTF-8 file. The character that it's not showing isn't a normal apostrophe, it's one of the angled "smart" quotes that Word uses. If you replaced it with a regular apostrophe it would display fine in any encoding.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...