<?php
教學(xué)網(wǎng)頁:http://m.miracleart.cn/code/1040.html#code_down_li
這行代碼在phpstorm中一直報(bào)錯(cuò):
C:\xampp\php\php.exe "D:\Yangsipeng\code\PS php CODE\reg.php"
PHP Notice:? Undefined index: username in D:\Yangsipeng\code\PS php CODE\reg.php on line 3
Notice: Undefined index: username in D:\Yangsipeng\code\PS php CODE\reg.php on line 3
PHP Notice:? Undefined index: pwd in D:\Yangsipeng\code\PS php CODE\reg.php on line 7
<br />
Notice: Undefined index: pwd in D:\Yangsipeng\code\PS php CODE\reg.php on line 7
<br />
Process finished with exit code 0
網(wǎng)頁中打開也是一樣的提示 html文件是按教學(xué)寫的 兩個(gè)文件也放在一起了
//$_GET后面加上中括號,將username作為字符串放在中括號里面,就得到了表單里面的<input type="text" name="username" /> 的值
$u = $_GET['username'];
echo $u.'<br />';
//$_GET['pwd'] 得到表單<input type="text" name="username" /> 的值
$passwd = $_GET['pwd'];
echo $passwd.'<br />';
?>
Undefined index: username? 你在PHP中直接打印一下? $_GET看看有沒有username這個(gè)字段啊