我正在尝试创建一个简单的 HTML 表单,将用户重定向到服务器显示的感谢消息,并用 PHP 编写。但是,我所做的一切似乎都不起作用。每次尝试运行代码时都会收到 405。如果我刷新页面,它将开始下载。我正在使用实时服务器扩展,并且安装了 PHP。
HTML 文件:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel = "stylesheet" type = "text/css" href = "styles-signup.css">
<script type = "text/javascript" src = "script-signup.js"></script>
</head>
<body>
<div>
<h1 class = "title"></h1>
</div>
<div class = "form">
<h1 id = "header">Create Your Account</h1>
<form method = "POST" id = "signup" action = "action.php">
<input name = "firstName" type = "text" placeholder="First Name" required id = "fname">
<input name = "lastName" type = "text" placeholder = "Last Name" required id = "lname">
<input name = "Email" type = "email" placeholder="email, e.g. person@gmail.com" required id = "mail">
<input name = "newPassword" type = "password" id = "password" placeholder="Password" required minlength="8" maxlength="25">
<input name = "passwordConfirm" type = "password" placeholder = "Confirm Password" required minlength="8" maxlength="25" id = "cpassword">
<br>
<input name = "gender" type = "radio" id = "male" required>
<label for = "gender" id = "mlabel">Male</label>
<input name = "gender" type = "radio" id = "female" required>
<label for = "gender" id = "flabel">Female</label>
<input name = "gender" type = "radio" id = "other" required>
<label for = "gender" id = "olabel">Other</label>
<br>
我收到此错误:
智慧大石