<?php
教學網頁:http://www.php.cn/code/1040.html#code_down_li
這行程式碼在phpstorm中一直報錯:
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
網頁中開啟也是一樣的提示html檔案是按教學寫的兩個檔案也放在一起了
//$_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 />';
?>