无法发送参数 [英] Cannot send parameters

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

问题描述

嘿所有,


我是PHP的新手,我只想测试一个简单的脚本如下:


[PHP]

#!C:/ Program Files / PHP / PHP.exe

<?php

error_reporting(E_ALL );;

ini_set(''display_errors'',true);


// import_request_variables(" gpc"," mvar_");


print" Content-type:text / html\\\
\\\
" ;;


if(isset($ _ GET [''name] ''])){

print" Hello," 。 $ _GET [''name''];

}

else {

print<<< HTML

< form action =" http://pladdypants.home/cgi-bin/ch6ex.php" method =" get">

名称:< input type =" text"命名= QUOT;名称" />

< input type =" submit"值= [提交" />

< / form>

HTML;

}

?>

[/ PHP]>


我已经在此工作并且运行正常,但是当我点击提交时在现场使用名称,它不会'' t重新出现时显示出来。网址发生变化,并在其中定义了参数,但没有任何内容打印到屏幕上。我在这里看到简单的东西吗?我尝试了很多不同的东西而且没有运气。


我正在使用XP专业版,mozilla浏览器,apache 2.2。这只是我的计算机作为服务器,我正在访问本地文件。这是我的代码问题,如何安装PHP,我的服务器是如何设置的?对不起这个愚蠢的问题,我肯定我正在做一些非常基本和愚蠢的事......任何帮助都会非常感激。


-Pladdy

Hey all,

I''m new to PHP and i''m just trying to test out a simple script as follows:

[PHP]
#!C:/Program Files/PHP/PHP.exe
<?php
error_reporting(E_ALL);
ini_set(''display_errors'', true);

//import_request_variables("gpc","mvar_");

print "Content-type: text/html\n\n";

if (isset($_GET[''name''])) {
print "Hello, " . $_GET[''name''];
}
else {
print <<<HTML
<form action="http://pladdypants.home/cgi-bin/ch6ex.php" method="get">
Name: <input type="text" name="name" />
<input type="submit" value="Submit" />
</form>
HTML;
}
?>
[/PHP]>

I''ve worked at this and it runs fine, however when i click submit with a name in the field, it doesn''t show up when it reruns. The url changes and it has a parameter defined there, but nothing prints to the screen. Am I overlooking something simple here? I''ve tried lots of different things and no luck.

I''m using XP Pro, mozilla browser, apache 2.2. This is just my computer as a server and i''m accessing local files. Is this an issue with my code, how PHP was installed, how my server is set up? Sorry for such a silly question, I''m sure I''m doing something very basic and stupid...Any help would be greatly appreciated.

-Pladdy

推荐答案

_GET [''name''])){

print" Hello," 。
_GET[''name''])) {
print "Hello, " .


_GET [''name''];

}

else {

print< ;<< HTML

< form action =" http://pladdypants.home/cgi-bin/ch6ex.php" method =" get">

名称:< input type =" text"命名= QUOT;名称" />

< input type =" submit"值= [提交" />

< / form>

HTML;

}

?>

[/ PHP]>


我已经在此工作并且运行正常,但是当我点击提交时在现场使用名称,它不会'' t重新出现时显示出来。网址发生变化,并在其中定义了参数,但没有任何内容打印到屏幕上。我在这里看到简单的东西吗?我尝试了很多不同的东西而且没有运气。


我正在使用XP专业版,mozilla浏览器,apache 2.2。这只是我的计算机作为服务器,我正在访问本地文件。这是我的代码问题,如何安装PHP,我的服务器是如何设置的?对于这样一个愚蠢的问题,我很抱歉,我确定我正在做一些非常基本和愚蠢的事情...任何帮助都将不胜感激。


-Pladdy
_GET[''name''];
}
else {
print <<<HTML
<form action="http://pladdypants.home/cgi-bin/ch6ex.php" method="get">
Name: <input type="text" name="name" />
<input type="submit" value="Submit" />
</form>
HTML;
}
?>
[/PHP]>

I''ve worked at this and it runs fine, however when i click submit with a name in the field, it doesn''t show up when it reruns. The url changes and it has a parameter defined there, but nothing prints to the screen. Am I overlooking something simple here? I''ve tried lots of different things and no luck.

I''m using XP Pro, mozilla browser, apache 2.2. This is just my computer as a server and i''m accessing local files. Is this an issue with my code, how PHP was installed, how my server is set up? Sorry for such a silly question, I''m sure I''m doing something very basic and stupid...Any help would be greatly appreciated.

-Pladdy


没有


这篇关于无法发送参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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