MSUK1 Posted October 13, 2010 Share Posted October 13, 2010 in the hard code this text  is not anywhere to be seen. HOWEVER. the final result prints this text before every php include.. the site is www.matt-cardle.co.uk ive noticed it only does it on pages after the landing page.. so www.matt-cardle.co.uk DOESNT SHOW but www.matt-cardle.co.uk/Home [and any other page] DOES SHOW the unclude i am using is like this for all page: "<?php include '../includes/ads2.php'; ?>" and text before and after this for example is..: <table style="width: 55%; height: 84px;" cellspacing="0" cellpadding="0" align="right"> <tr> <td style="height: 23px" class="style9"><?php include '../includes/ads2.php'; ?></td> </tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/ Share on other sites More sharing options...
btherl Posted October 13, 2010 Share Posted October 13, 2010 That's a byte order marker: http://en.wikipedia.org/wiki/Byte_order_mark Your editor probably isn't showing it because it understands the marker and is letting you edit the file as UTF-8. I can't suggest a solution unfortunately as I'm not familiar with how BOM files work with PHP. Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1121939 Share on other sites More sharing options...
MSUK1 Posted October 14, 2010 Author Share Posted October 14, 2010 its strange because this happened AFTER i uploaded it all again.. it never happened, then i re-uploaded the site and it happened again :/ Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1122002 Share on other sites More sharing options...
PFMaBiSmAd Posted October 14, 2010 Share Posted October 14, 2010 Save the files without the BOM characters, using your programming editor. Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1122003 Share on other sites More sharing options...
MSUK1 Posted October 14, 2010 Author Share Posted October 14, 2010 in the text editor those charecters are not even their :/ as shown above the scripts starts <?php and ends ?> Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1122004 Share on other sites More sharing options...
PFMaBiSmAd Posted October 14, 2010 Share Posted October 14, 2010 The BOM characters are placed at the start of the file by your editor when the file is saved. They are not characters in the source code in the file. Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1122005 Share on other sites More sharing options...
MSUK1 Posted October 14, 2010 Author Share Posted October 14, 2010 as this is new and ive not come accross it before, here is the head of the file.. im using sharepoint it doesnt usualy insert the BOM chareceters or hasnt done before and as you can see www.matt-cardle.co.uk/ NOT BOM and /Home BOM.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <meta http-equiv="Content-Language" content="en-gb" /> <title>Matt Cardle | X Factor Official Site</title> <meta name="description" content="27-year-old Matt Cardle Official Website. Sign the guestbook. List. Watch and support Matt Cardle from X Factor 2010" /> <meta name="keywords" content="Matt, Cardle, X Factor, Official, Music, Youtube, Videos, Audition, Bootcamp, Live Shows, Syco, SycoTV, Modest, Model, Actor, Singer, Dancer, 2010" /> <meta name="robots" content="index,follow" /> <link rel="shortcut icon" href="http://matt-cardle.co.uk/favicon.ico" /> <link type="text/css" rel="stylesheet" href="../style/style.css" /> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-16806414-2']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <style type="text/css"> .style1 { background-color: #A5ABDA; } </style> </head> Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1122006 Share on other sites More sharing options...
btherl Posted October 14, 2010 Share Posted October 14, 2010 Is sharepoint what you use to edit the files? You might want to try googling "sharepoint bom" and see if any of those help. Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1122008 Share on other sites More sharing options...
MSUK1 Posted October 14, 2010 Author Share Posted October 14, 2010 ok so ive read i should change the language at which im writing in, site settings -> language. but what do i change it too? this one post said ANYTHING BUT UTF-8 can i be completly honest and say, i have NO idea what the difference is, what visual changes any UTF formats make or how all of a sudden the next time i upload my site it has the BOM included Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1122009 Share on other sites More sharing options...
btherl Posted October 14, 2010 Share Posted October 14, 2010 I would try Ascii or ISO-8859-1 if those are options. "Plain text" is another good one if that's available. Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1122012 Share on other sites More sharing options...
MSUK1 Posted October 14, 2010 Author Share Posted October 14, 2010 ive changed it to, us/western european (iso) still any idea why it does this for one page and not another? EDIT: i change it to any other encoding language click okay and when i open site settings again, it goes back to unicode-8 there is something strange going on, have you looked at the site, visit: www.matt-cardle.co.uk then click on Home, those pages are identical doesnt make sense for one and not the other :/ Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1122014 Share on other sites More sharing options...
MSUK1 Posted October 14, 2010 Author Share Posted October 14, 2010 ---- TO SOLVE ---- within the <head> tagsv replace: <meta http-equiv="content-type" content="text/html" /> with <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> and you can see the difference. this will solve it, courtesy of www.msukgroup.co Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1122219 Share on other sites More sharing options...
frizi Posted October 14, 2010 Share Posted October 14, 2010 and than at first row insert this: <?php header("Content-Type: text/html; charset=UTF-8"); ?> + get Nodepad++, open one of your files, change the encoding to UTF8 - without BOM and see if there will be the signs. Let us know :]. Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1122287 Share on other sites More sharing options...
MSUK1 Posted October 17, 2010 Author Share Posted October 17, 2010 yup :] i think this post should be put somewhere special? it took me days to find such a simple solution Quote Link to comment https://forums.phpfreaks.com/topic/215817-this-appears-before-every-php-include-%C3%AF%C2%BB%C2%BF-why/#findComment-1123108 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.