View Single Post
Old 12-15-2009, 02:35 PM  
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
CODERS: Do NOT let clients use Expression to modify php files!

I'm posting this up to save any other coders a very very long search through lots of code...

Microsoft Expression inserts an invisible mark called a 'byte order mark (http://en.wikipedia.org/wiki/Byte-order_mark)'. It causes the php scripts to output ? at the end of files, but its invisible in the code even in other editors. The only way to see it is if you output something before the byte order mark was inserted:

In my case, my client opened the scripts config file, changed something and saved it (thus inserting this invisible mark that even i couldn't see in another editor afterwards).

<?
include('config.php');
?>

Outputted nothing, whereas

<?
echo 'test';
include('config.php');
?>

Would output "test?", yet config.php itself had no output at all.

So in summary, if you are experiencing mysterious code problems and are convinced you have gone mad, ask if someone using expression has edited your code
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote