You are here: Re: problem with simple php code « PHP Programming Language « IT news, forums, messages
Re: problem with simple php code

Posted by Dave Pyles on 11/22/06 02:11

On 11/21/2006 7:37 PM, alice@fearofdolls.com wrote:
> I'm just learning php, and one of the first things in the book I'm
> reading has me make this file-
> <html>
> <head>
> <title>PHP Test</title>
> </head>
> <body>
> <p>This is an HTML line
> <p>
> <?php
> echo "This is a PHP line";
> Phpinfo();
> ?>
> </body>
> </html>
>
> I typed in in Notepad, saved it as test.php, ftp it to my ISP, then
> viewed in a browser and got the following error-
> Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in
> /home/fearofdo/public_html/test2.php on line 9
>
> I asked my ISP if php/mysql was installed and turned on and configured
> correctly, they said yes and that my code was wrong, that it had <93>
> and <94> where there should have been quotes, so they changed it and
> now it works, creating the proper display.
>
> This is all very odd to me...when I look at the original file that my
> ISP said they corrected, there are now double quotes around the line
> This is a PHP line. I created a new file from scratch, made sure it had
> quotes, uploaded it and what do you know, I get the error message
> again. When I view the file/code from my FTP client, it shows the
> quotes, absolutely the correct code, so why is it not working?
>
> I guess my question is, what the heck is happening? I'm not even sure
> where to begin...how and why is the code getting changed, and if it is
> getting changed, why does it not look to me like it has changed, and
> why the <93>...where does that come from? How do I prevent this?
>
Try writing your file like this:

<!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=iso-8859-1" />
<title>First PHP Script</title>
</head>
<body>
<?php
phpinfo();
?>
</body>
</html>

That should return the PHP Info page.

Dave Pyles

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация