Jump to content

Archived

This topic is now archived and is closed to further replies.

donkey

weird display

Recommended Posts

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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
Ohhh. I did save it as a html file. My bad!

Thanks for all your help people.

Share this post


Link to post
Share on other sites
The server can be configured to execute PHP script from any file extension. This is, however, not adviseable.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.