php编程中如何定义

来源:百度知道 编辑:UC知道 时间:2024/05/30 03:31:39
我在编php时出现了以下错误提示:
Notice: Undefined index: username in d:\usr\www\html\register.php on line 2

Notice: Undefined index: pwd in d:\usr\www\html\register.php on line 3

Notice: Undefined index: repeat-pwd in d:\usr\www\html\register.php on line 4

Notice: Undefined index: name in d:\usr\www\html\register.php on line 5

Notice: Undefined index: email in d:\usr\www\html\register.php on line 6

直接使用了$_POST['username'],而这时的$_POST['username']恰恰是空值,即NULL;

所以会提示以上信息!即'username'等字段未定义!

你没有加$符号?
$username $pwd....

使用了数组中不存在的索引

加冒号

用$,如$username, 我喜欢$这个符号!~哈哈