Welcome to WebmasterWorld Guest from 50.16.112.199

Forum Moderators: coopster & jatar k

Unusual Characters showing up in my files

unknown PHP characters

   
7:20 pm on Jul 21, 2004 (gmt 0)

10+ Year Member





The characters above have been showing up in my html files that are running php scripts. The script is running just fine, except for those mysterious characters that sit a top the page.

The characters only show up when viewed in a browser, I cannot see them in the html or php script files themselves. Does anyone have a clue where they come from?

I create my php files using notepad and occasionally I'll edit them with DreamweaverMX.

Thanks

8:10 pm on Jul 21, 2004 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



can you pinpoint where in the script they are occurring?
I used to get that when I would include a script with no output from another server for tracking.

I supressed the output using @

see PHP Error Control Operators [ca2.php.net]

8:16 pm on Jul 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are the chars showing up when you make a new file that includes PHP in Notepad and then DON'T edit it in Dreamweaver?

Are you sure you are using ASCII mode to tranfer the files to your web server? Those look like binary file transfer artifacts...

8:31 pm on Jul 21, 2004 (gmt 0)

10+ Year Member



These characters appear at the very begining of the script.

I usually open notepad and write the php there, then save it as filename.php, Then I upload the file to my server with DreamweaverMX. I have edited the files in Dreamweaver a few times after seeing those spurious characters appearing on the page. Nothing worked to get rid of it.

I think you might be on to something when you mentioned ASCII. I do not see an option in DreamweaverMX to choose transfer type. Or maybe I just don't know how to do it. I'll check my server upload feature or I'll try using ws-ftp for upload. I'll let you know how it goes.

Thanks
BKLYN

9:03 pm on Jul 21, 2004 (gmt 0)

10+ Year Member



I used my file manager feature in the Cpanel to edit the file online and I could see those characters in the file there even though I could not see them in the same file on my local host.

After editing the file online I no longer see those charcaters on the page. Something happened to the file during upload.

9:26 pm on Jul 21, 2004 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I used to have that same problem as well when I created files on my Mac and the put them on a windows machine. I would never have problems went to our sun or linux servers though.
10:03 pm on Jul 21, 2004 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



I've had these exact characters show up too, but I can't remember why.

Is it possible that you might be seeing a unicode BOM [unicode.org], a remnant of looking at a unicode text in a non-unicode environment. Does that sound possible?

Possibly big-endian text in a low-endian environment?

4:11 pm on Jul 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Many webpage programs, perhaps even Dreamweaver, have a section in the preferences/options that allows you to specify file types (extensions) that you always want to transfer as ASCII, regardless of how its MIME type is handled by default.

Perhaps Dreamweaver doesn't know about .PHP files, and so assumes them to be binary...?

Look for the setting in your preferences/options that lists the types to transfer as ASCII, and add .PHP to the list.

In WS_FTP it's in the Options->Extensions section.

Just guessing, but I'll bet you're on the right track.

4:06 pm on Aug 9, 2004 (gmt 0)

10+ Year Member



Dreamweaver knows what php files are and how to transfer them ;) its one of the fastest growing programming suites available today, with rapid development and support for numerous lang. including vb C# which makes programmers life a heaven, and dreamweaver doesnt have the option to choose what type of file transfer mode you want because people DO MESS UP and they want to reduce the and make life simplistic for you (all datafies .html, .php, .asp, .aspx, .cfml, .cfm) are all transfered correctly in the right mode. What the problem is the fact that you are including the BOM Unicode signature in dreamweaver, which makes those invalid character. It shows up on my intranet, extranet, devnet, and hosting server. Dending on what version of DW mx you are using will depend on how you DONT include the BOM signature.

In DW MX 2004 (my version) you can dis-include the BOM signature by doing the following:

Modify > Page Properties > Title/Encoding

Now try and find your Unicode Normalization form and look right below it you will see INCLUDE UNICODE SIGNATURE (BOM) if its check uncheck it, if its not check then check it, save the file and then go back in and uncheck it!

4:32 pm on Aug 9, 2004 (gmt 0)

WebmasterWorld Administrator rogerd is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to WebmasterWorld, jordonbedwell. Nice insight!
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month