homepage Welcome to WebmasterWorld Guest from 54.211.181.45
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Unusual Characters showing up in my files
unknown PHP characters
Brooklynese

10+ Year Member



 
Msg#: 4485 posted 7:20 pm on Jul 21, 2004 (gmt 0)



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

 

jatar_k

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



 
Msg#: 4485 posted 8:10 pm on Jul 21, 2004 (gmt 0)

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]

StupidScript

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4485 posted 8:16 pm on Jul 21, 2004 (gmt 0)

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...

Brooklynese

10+ Year Member



 
Msg#: 4485 posted 8:31 pm on Jul 21, 2004 (gmt 0)

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

Brooklynese

10+ Year Member



 
Msg#: 4485 posted 9:03 pm on Jul 21, 2004 (gmt 0)

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.

jatar_k

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



 
Msg#: 4485 posted 9:26 pm on Jul 21, 2004 (gmt 0)

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.

ergophobe

WebmasterWorld Administrator ergophobe us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4485 posted 10:03 pm on Jul 21, 2004 (gmt 0)

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?

StupidScript

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4485 posted 4:11 pm on Jul 23, 2004 (gmt 0)

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.

jordonbedwell

10+ Year Member



 
Msg#: 4485 posted 4:06 pm on Aug 9, 2004 (gmt 0)

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!

rogerd

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



 
Msg#: 4485 posted 4:32 pm on Aug 9, 2004 (gmt 0)

Welcome to WebmasterWorld, jordonbedwell. Nice insight!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved