正在尝试编写注册形式。
<?php
include_once 'core.php';
if (User::IsAuthorization()) {
header("Location: /");
}
if(!is_null($_POST["Registration"])){
User::Registration($_POST["login"], $_POST["password"]);
$user = new User();
$user->Authorization($_POST["login"], $_POST["password"]);
$user->SetSession();
header("Location: /");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Регистрация</title>
</head>
<body>
<form action="registration.html" method="POST">
<input type="text" name="login" placeholder="login">
<input type="password" name="password" placeholder="password">
<input type="submit" value="Регистрация" name="Registration">
</form>
</body>
</html>
此表单在我朋友的笔记本电脑上正常工作。但就我而言,输出包含 php 代码。我使用 denwer 作为本地服务器。它包含以下代码(但不必):
Authorization($_POST["login"], $_POST["password"]); $user->SetSession(); header("Location: /"); } ?>
图片链接:http://s23.postimg.org/5vv204qor/Capture.png
只需启动您的服务器并使用本地主机将其显示在网页上。它应该显示与 fd 笔记本电脑上显示的页面相同的页面。
如果没有,它可能忘记在文件名中包含或更改 html 为 php。
谢谢