the if statement doesn't seem to work when i submit the button by clicking the login button. I am running XAMPP, with MySQL and Apache Modules onn.. I have tried lot of ways to solve this, but none seems to work.I have also checked by using different names for the button(didn't work)
<!DOCTYPE html>
<html>
<head>
<title>welcome</title>
</head>
<body>
<div id="inputContainer">
<form id="registerform" action="register.php" methods= "POST">
<?php
if(isset($_POST['submit'])){
echo "login button was pressed";
}
?>
<h2>Login to your account</h2>
<p>
<label for="loginuserName">Username</label>
<input id="loginuserName" type="text" name="loginuserName"
placeholder="e.g stacy" required>
</p>
<p>
<label for="loginpassword">Password</label>
<input id="loginpassword" type="password" name="loginpassword" required>
</p>
<button type="Submit" value="Submit" name="submit">login</button>
</form>
<form id="loginForm" action="register.php" methods="POST">
<h2>Register for free</h2>
<p>
<label for="loginuserName">Username</label>
<input id="loginuserName" type="text" name="loginuserName" placeholder="e.g stacy" required>
</p>
<p>
<label for="Firstname">first name</label>
<input id="Firstname" type="text" name="Firstname" placeholder="e.g stacy" required>
</p>
<p>
<label for="lastname">last name</label>
<input id="lastname" type="text" name="lastname" placeholder="e.g reddy" required>
</p>
<p>
<label for="email">Email</label>
<input id="email" type="email" name="email" placeholder="e.g redstacy@gamil.com" required>
</p>
<p>
<label for="email2">Username</label>
<input id="email2" type="email" name="email2" placeholder="e.g redstacy@gamil.com" required>
</p>
<p>
<label for="loginpassword">Your Password</label>
<input id="loginpassword" type="password" name="loginpassword" required>
</p>
<p>
<label for="loginuserpassword">Re-enter Password</label>
<input id="loginuserpassword" type="password" name="loginuserpassword" required>
</p>
<button type="submit" name="regbutton">sign up</button>
</form>
</div>
</body>
</html>
Aucun commentaire:
Enregistrer un commentaire