philspliff Posted May 19, 2010 Share Posted May 19, 2010 Hi I'm sure this is not something new but I can't seem to find a solution. When using include or echo they leave a full stop in the created document. These are causing a layout problem by moving <div's> out of place. How is this stopped. Sorry for the dumb question Quote Link to comment https://forums.phpfreaks.com/topic/202297-periods-being-left-from-code-causing-layout-problems/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 19, 2010 Share Posted May 19, 2010 Php only outputs what your php code says to output or anything that is not inside of the <?php ?> tags gets automatically output. If you are getting characters output that you don't want, you would need to find out where they are coming from in your source files and remove them. Quote Link to comment https://forums.phpfreaks.com/topic/202297-periods-being-left-from-code-causing-layout-problems/#findComment-1060806 Share on other sites More sharing options...
philspliff Posted May 19, 2010 Author Share Posted May 19, 2010 I have just noticed that it is not a full stop Third line of code first character. It is half way up the height of the line. Every time a piece of php output is inserted into the page including simple text/html files this character is added before the output. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/202297-periods-being-left-from-code-causing-layout-problems/#findComment-1060836 Share on other sites More sharing options...
kenrbnsn Posted May 19, 2010 Share Posted May 19, 2010 Please post the PHP code between tags. Quote Link to comment https://forums.phpfreaks.com/topic/202297-periods-being-left-from-code-causing-layout-problems/#findComment-1060840 Share on other sites More sharing options...
philspliff Posted May 19, 2010 Author Share Posted May 19, 2010 Main page would have this in it <div class="maincontainer"> <?php include "phpfiles/navheader.txt" ?> navheader.txt is as follows: <div class='header'> <div class='photocrafted bgimg'> <a class='navlink' href='http://www.photocrafted.com/index.php'> <img src='http://www.photocrafted.com/buttons/photocraftedblackpink.gif' class='photocraftedimg' alt='photocrafted' /> </a> </div> <div class='navholder'> <div class='navholderbg'> <img class='navholderbg' src='http://www.photocrafted.com/buttons/navbars.gif' alt='navbars' /> <div class='navtopleft bgimg'> <a href='http://www.photocrafted.com/weddings.php'> <img class='navtopleft' src='http://www.photocrafted.com/buttons/weddings.gif' alt='weddings' /> </a> </div> <div class='navtopright bgimg'> <a href='http://www.photocrafted.com/galleries.php'> <img class='navtopright' src='http://www.photocrafted.com/buttons/gallery.gif' alt='galleries' /> </a> </div> <div class='navbottomleft bgimg'> <a href='http://www.photocrafted.com/events.php'> <img class='navbottomleft' src='http://www.photocrafted.com/buttons/events1.gif' alt='events' /> </a> </div> <div class='navbottomright bgimg'> <a href='http://www.photocrafted.com/contact.php'> <img class='navbottomright' src='http://www.photocrafted.com/buttons/contact1.gif' alt='contact' /> </a> </div> </div> </div> </div> The text file is saved as utf-8 using notepad++ as an editor This results in the following output as shown in the attached file. I tried to paste it directly into here as it but the strange character does not show up!! [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/202297-periods-being-left-from-code-causing-layout-problems/#findComment-1060850 Share on other sites More sharing options...
kenrbnsn Posted May 19, 2010 Share Posted May 19, 2010 If you're saving as UTF-8, make sure you save it without the BOM character. If you save it with the BOM, that puts the weird character in front of the opening "<?php". Ken Quote Link to comment https://forums.phpfreaks.com/topic/202297-periods-being-left-from-code-causing-layout-problems/#findComment-1060851 Share on other sites More sharing options...
philspliff Posted May 19, 2010 Author Share Posted May 19, 2010 Thank you to kenrbnsn, this solved my problem and made the file noticeably smaller. Encode as "utf-8 without BOM" Cheers Quote Link to comment https://forums.phpfreaks.com/topic/202297-periods-being-left-from-code-causing-layout-problems/#findComment-1060853 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.