我是新来的php,我有一个小问题Undefined
索引。注意:未定义索引:5
说明:未定义指数:米诺在C:\ XAMPP \ htdocs中\的index.php上线20
说明:未定义指数:heslo在C:\ XAMPP \ htdocs中\上线21的index.php
我的代码:
<!DOCTYPE html>
<html>
<head>
<title>Prihlásenie sa na stránku</title>
</head>
<h1>
<center>
Prihlásenie
</center>
</h1>
<body>
<form action="prihlasenie.php" method="post">
<P>Meno: <input type="text" name="meno"></input></P>
<P>Heslo: <input type="password" name="heslo"></input></P>
<P><input type="submit" value="prihlasit"></input></P>
</form>
<?php
$uname = $_POST["meno"];
$passwd = $_POST["heslo"];
if ((empty($uname)) or (empty($passwd)))
{
echo "Vyplnte meno a heslo!";
}
?>
</body>
</html>
THX的响应(对不起,我的英语)
检查是否'POST'试图使用它之前填充。另外'h1'应该放在'body'中。 – chris85