donkey Posted March 8, 2006 Share Posted March 8, 2006 Hey People, I'm new to PHP.After installing and configuring PHP, I wrote some code to test it out.[code]<!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"><head><meta http-equiv="Content-Type" content="text/html; charset=big5" /><title>Untitled Document</title></head><body><?php$myString = "Hello!";echo $myString;echo "<h5>Hello Word!</h5>";?></body></html>[/code]However I'm getting some strange extranneous characters in firefox:Hello World!"; ?>and doesn't display anything in IE.I was wondering how could I resolve this problem.Thanks Quote Link to comment https://forums.phpfreaks.com/topic/4398-weird-display/ Share on other sites More sharing options...
me1000 Posted March 8, 2006 Share Posted March 8, 2006 I dont see anytihng wrong with it, But thats not saying that much...if I understand how PHP works firefox shouldnt be the problem.{edit} Tried the code on my server, and it works fine! Quote Link to comment https://forums.phpfreaks.com/topic/4398-weird-display/#findComment-15256 Share on other sites More sharing options...
AV1611 Posted March 8, 2006 Share Posted March 8, 2006 While I don't see a problem with the code, let me ask you this: What is the filename the code is in? If it is in a file with .HTML you will get odd results... It needs to be in a file with the .PHP extension... Quote Link to comment https://forums.phpfreaks.com/topic/4398-weird-display/#findComment-15263 Share on other sites More sharing options...
donkey Posted March 8, 2006 Author Share Posted March 8, 2006 Ohhh. I did save it as a html file. My bad!Thanks for all your help people. Quote Link to comment https://forums.phpfreaks.com/topic/4398-weird-display/#findComment-15267 Share on other sites More sharing options...
txmedic03 Posted March 9, 2006 Share Posted March 9, 2006 The server can be configured to execute PHP script from any file extension. This is, however, not adviseable. Quote Link to comment https://forums.phpfreaks.com/topic/4398-weird-display/#findComment-15638 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.