Jump to content


Photo

weird display


  • Please log in to reply
4 replies to this topic

#1 donkey

donkey
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 08 March 2006 - 02:48 AM

Hey People, I'm new to PHP.

After installing and configuring PHP, I wrote some code to test it out.

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

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

#2 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 08 March 2006 - 02:56 AM

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!

#3 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 08 March 2006 - 03:14 AM

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



#4 donkey

donkey
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 08 March 2006 - 03:21 AM

Ohhh. I did save it as a html file. My bad!

Thanks for all your help people.

#5 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 09 March 2006 - 01:32 AM

The server can be configured to execute PHP script from any file extension. This is, however, not adviseable.

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users