bmroyer Posted August 6, 2013 Share Posted August 6, 2013 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 More sharing options...
justsomeguy Posted August 6, 2013 Share Posted August 6, 2013 Look at the source code in the browser, the content div is in a different position. In the PHP version the content div is before the leftbar and rightbar, in the HTML version it's after those. Link to comment Share on other sites More sharing options...
bmroyer Posted August 7, 2013 Author Share Posted August 7, 2013 Yeah I already tried that. The updated version is up with the div in the correct position according to the html. Still broken. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 7, 2013 Share Posted August 7, 2013 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 More sharing options...
bmroyer Posted August 7, 2013 Author Share Posted August 7, 2013 (edited) 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 August 7, 2013 by bmroyer Link to comment Share on other sites More sharing options...
justsomeguy Posted August 7, 2013 Share Posted August 7, 2013 Those are characters that aren't encoded correctly. If that text is coming out of a database then you might need to use utf8_encode to encode it as UTF-8 text. Link to comment Share on other sites More sharing options...
bmroyer Posted August 8, 2013 Author Share Posted August 8, 2013 Nothing is coming from a database. Everything is still html pretty much. It doesn't recognize the " ' " for some reason. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 8, 2013 Share Posted August 8, 2013 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now