I need help on my sign up page. I made an alert for the users to see that all the fields are required . My problem is every time I click OK on the alert it redirects to signupMysql.php which is a blank page. Want I want is for it to stay on signup.php as long as some as the fields are not complete.
I think the action has something to do with my problem.
Here is my signup.php
<form class="register-form" action="signupMysql.php" method="post">
<p class="message">Don't have an account?</p>
<input type="text" placeholder="Username" name="username">
<input type="text" placeholder="Last Name" name="lastname">
<input type="text" placeholder="First Name" name="firstname">
<input type="text" placeholder="Contact Number" name="contactnum">
<input type="text" placeholder="Email address" name="email">
<input type="password" placeholder="Password" name="password">
<input type="password" placeholder="Re-enter Password" name="repassword">
<input type="Submit" value="Sign Up">
</form>
some of the codes of my signupMysql.php
if (empty($username) || empty ($lastname) || empty($firstname) ||
empty($contactnumber) || empty($email)
|| empty ($password) || empty ($repassword)){
$message = "Fill all fields";
echo "<script type='text/javascript'>alert('$message');</script>";
}
I hope someone could help me. Thank you so much in advance.