Hey all i am working on a simple registration form and i have done a simple test on it. basically i said if the username filed is empty and we click submit it will echo out 'all filed's are required' else Ok. My code looks fine or else i am going insane can some one have a look for me thank you :)
CODE:
<?php
//require 'core.inc.php';
if(isset($_POST['username'])&& isset($_POST['password']) && isset($_POST['passwordAgain'])&& isset($_POST['Firstname'])&& isset($_POST['Lastname'])){
$username = $_POST['username'];
$password = $_POST['password'];
$password_again = $_POST['passwordAgain'];
$Firstname = $_POST['Firstname'];
$Lastname = $_POST['Lastname'];
if(!empty($username)){
echo 'OK.';
}else{
echo 'fill in all details thank you';
}
}
?>
<form action="join.inc.php" method="POST">
Username: <input type="text" name="username" /><br />
Password: <input type="password" type="password" /><br />
Password Again: <input type="password" type="passwordAgain" /><br />
FirstName: <input type="text" name ="Firstname"/><br />
LastName: <input type="text" name ="Lastname" /><br />
<input type="submit" value="SUBMIT" />
</form>