我是新的PHP,但我已经做了一个注册脚本,工作正常。但问题是每次按下提交按钮来检查我的错误,我将进入一个新的页面。PHP错误显示
我的问题是我如何让错误出现在同一页上?
我用于html表单的代码。
我想错误显示在我犯的错误div框任何想法?
<div id="RegistrationFormLayout">
<h1>Registration Page</h1>
<div id="ErrorMessage"></div>
<form action="script/registration.php" method="post">
<label for="Username">Username</label>
<input type="text" name="Regi_username">
<label for="FirstName">FirstName</label>
<input type="text" name="Regi_Firstname">
<label for="LastName">LastName</label>
<input type="text" name="Regi_Lastname">
<label for="EamilAddress">Regi_EmailAddres</label>
<input type="text" name="Regi_EmailAddres">
<label for="Password">Password</label>
<input type="password" name="Regi_password">
<button type="submit" value="Submit" class="Login_button">Login</button>
</form>
</div>
使用会话错误信息存储为字符串,并显示在同一页上是否存在 – GBD
当你点击提交表单,它重定向到'script/registration.php'因为你的'action =“script/registration.php”'。 – irrelephant
表单在'registration.php'中? – itachi