[还是不行啊...还是出现这个错误: Undefined index:username in c:\interpub\wwwroot\test.php on line 12但是输入数据后点"Submit".却能正确显示.不知道为何啊...]========= 在PHP语句中加入下面的试试<?PHP if (isset($username)) echo $_POST["username"]; ?>
不加上 if (isset($username)) 虽然会出现:Undefined index:username in c:\interpub\wwwroot\test.php on line 12 但输入后点"Submit"能正常显示. 加上if (isset($username)) 后什么也不显示了...救命啊...
echo($_POST["username"]; ==> echo($_GET["username"];
Undefined index:username in c:\interpub\wwwroot\test.php on line 12但是输入数据后点"Submit".却能正确显示.不知道为何啊...
echo($_POST["username"];
?>上面应该改成
echo $_GET["username"];那左边半个(是不需要的
我把它换成echo $_GET["username"];
但还是一样.
难道是PHP的问题?我的是4.3.7&&IIS6.0
<!-- test.php -->
<FORM METHOD="POST" ACTION="test.php">
Please type yuour name here:<BR>
<INPUT NAME="username" TYPE=TEXT><BR><BR>
<INPUT NAME="submit" TYPE=SUBMIT>
</FORM>
<BR><BR>
you typed:
<?php
echo($_POST["username"]);
?> </HTML>结果还是不行...郁闷...
Undefined index:username in c:\interpub\wwwroot\test.php on line 12但是输入数据后点"Submit".却能正确显示.不知道为何啊...]=========
在PHP语句中加入下面的试试<?PHP
if (isset($username))
echo $_POST["username"];
?>
加上if (isset($username)) 后什么也不显示了...救命啊...
或在程序开头加上:
error_reporting(E_ALL & ~E_NOTICE);
代码有没有错误啊?