简单的PHP代码的问题 [英] problem with simple php code

查看:56
本文介绍了简单的PHP代码的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是在学习php,而且这本书中的第一件事我是

阅读让我制作这个文件 -

< html> ;

< head>

< title> PHP Test< / title>

< / head>

< body>

< p>这是一个HTML行

< p>

<?php

echo"这是一个PHP行" ;;

Phpinfo();

?>

< / body> ;

< / html>


我在记事本中键入,将其保存为test.php,将其保存到我的ISP,然后

在浏览器中查看并收到以下错误 -

解析错误:解析错误,意外T_STRING,期待'',''或'';''
$ b第9行$ b /home/fearofdo/public_html/test2.php


我问我的ISP是否安装了php / mysql并打开并配置

正确的,他们说是的,我的代码是错的,它有< 93>

和< 94那里应该是引用,所以他们改变了它,现在它可以工作,现在它可以正常显示。


这对我来说都很奇怪......我看一下原来的文件,我的

ISP说他们纠正了,现在有双线报价

这是一个PHP行。我从头开始创建了一个新文件,确保它有

引号,上传它和你知道什么,我再次收到错误信息

。当我从我的FTP客户端查看文件/代码时,它显示了

引号,绝对是正确的代码,为什么它不起作用?


我猜猜我的问题是,到底发生了什么?我甚至都不确定

从哪里开始......如何以及为什么代码会发生变化,如果它被改变了,那么为什么它不会变化对我来说,它已经发生了变化,并且

为什么< 93> ...来自哪里?我如何防止这种情况?

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 <94where 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?

推荐答案

我对< 93or< 94tags一无所知,但代码是你发布

在我的设置上工作正常。


你提到你把它保存为test.php,但后来说错误

发生在" /home/fearofdo/public_html/test2.php"。你确定你b $ b只看一个文件吗? test.php vs. test2.php?

I don''t know anything about <93or <94tags, but the code you posted
works fine on my setup.

You mentioned that you saved it as "test.php", but then said the error
occured at "/home/fearofdo/public_html/test2.php". Are you sure you
are looking at only one file? test.php vs. test2.php?




< al *** @ fearofdolls.comwrote in message

新闻:11 ********************* @ m7g2000cwm.googlegrou ps.com ...

<al***@fearofdolls.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...

我只是在学习php,这本书中的第一件事我是

阅读让我制作这个文件 -

< html>

< head>

< title> PHP Test< / title>

< / head>

< body>

< p>这是一个HTML行

< p>

<?php

echo这是一个PHP行;

Phpinfo();

?>

< ; / body>

< / html>


我在记事本中键入,将其保存为test.php,将其保存到我的ISP,然后

在浏览器中查看并收到以下错误 -

解析错误:解析错误,意外T_STRING,期待'',''或'';''在

/ home / fe第9行的arofdo / public_html / test2.php


我问我的ISP是否安装了php / mysql并打开并正确配置了

,他们说是的并且我的代码错了,它有< 93>

和< 94其中应该有引号,所以他们改变它并且

现在它可以工作,创建正确的显示。


这对我来说都很奇怪...当我看到原始文件我的

ISP说他们纠正了,有现在双线报价

这是一个PHP行。我从头开始创建了一个新文件,确保它有

引号,上传它和你知道什么,我再次收到错误信息

。当我从我的FTP客户端查看文件/代码时,它显示了

引号,绝对是正确的代码,为什么它不起作用?


我猜猜我的问题是,到底发生了什么?我甚至都不确定

从哪里开始......如何以及为什么代码会发生变化,如果它被改变了,那么为什么它不会变化对我来说,它已经发生了变化,并且

为什么< 93> ...来自哪里?我该如何防止这种情况?
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 <94where 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?



唯一让我想到的是,你使用什么传输模式和你的FTP软件。
你的FTP软件。你使用的是自动,二进制还是ASCII。

你的脚本在这方面工作正常。

问候,


布伦特帕尔默。

The only thing springs to mind is, what transfer mode are you using with
your FTP software. Are you using auto, binary or ASCII.
Your script works fine this end.
Regards,

Brent Palmer.


2006年11月21日16:37:41 -0800, al *** @ fearofdolls。 com 写道:
On 21 Nov 2006 16:37:41 -0800, al***@fearofdolls.com wrote:

>我只是在学习php,而且书中的第一件事我是
阅读让我制作这个文件 -
< html>
< head>
< title> PHP Test< / title>
< / head>
< body>
< p>这是一个HTML行
< p>
<?php

echo"这是一个PHP行" ;

Phpinfo();
?>
< / body>
< / html>

我输入了记事本,保存为test.php,ftp到我的ISP,然后在浏览器中查看并得到以下错误 -
解析错误:解析错误,意外T_STRING,期待'','或'';''在
/ home / fearofdo / public_第9行的html / test2.php

我问我的ISP是否安装了php / mysql并正确配置
,他们说是的,我的代码错了,它有< 93>
和< 94其中应该有引号,所以他们改变它并且
现在它可以工作,创建正确的显示。
>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 <94where there should have been quotes, so they changed it and
now it works, creating the proper display.



我不知道记事本是怎么发生的,但它看起来像我这样

可能是智能引号字符91和92而不是单引号。


字符(十进制)93和94是]和^

-

问候,保罗Herber,Sandrila Ltd. http://www.pherber.com/

Diacrit重音字符 http://www.diacrit.sandrila.co。英国/

标题中的电子邮件地址无效。

Don''t know how this is happening in Notepad but it looks to me like it
could be smart quotes characters 91 and 92 instead of a single quote.

Characters (decimal) 93 and 94 are ] and ^
--
Regards, Paul Herber, Sandrila Ltd. http://www.pherber.com/
Diacrit accented characters http://www.diacrit.sandrila.co.uk/
Email address in headers is invalid.


这篇关于简单的PHP代码的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆