$submit = $_POST['submit']; $fullname = strip_tags($_POST['fullname']); $username = strip_tags($_POST['username']); $emailaddress = strip_tags($_POST['emailaddress']); $repeatemailaddress = strip_tags($_POST['repeatemailaddress']); $password = strip_tags($_POST['password']); $repeatpassword = strip_tags($_POST['repeatpassword']); $date = date("Y-m-d"); if ($submit) { //check for existance if ($fullname&&$username&&$emailaddress&&$repeatemailaddress&&$password&&$repeatpassword) { //encrypt password $password = md5($password); $repeatpassword = md5($repeatpassword); if ($password=$repeatpassword&&$emailaddress=$repeatemailaddress) { //check character length of username and fullname if (strlen($username)>25||strlen($fullname)>25) { echo "Length of username or fullname is too long!"; } else { //check email length if (strlen($emailaddress)>50||strlen($emailaddress)<10) { echo "Your email address must be between 10 and 50 characters!"; } else { //check password length if (strlen($password)>25||strlen($password)<6) { echo "Your password must be between 6 and 25 characters!"; } else { //register the user echo "Success!"; } } } } else echo "Your passwords or email address do not match!"; } //wnd of password/email check else echo "Please fill in all fields!"; }
if ($password=$repeatpassword&&$emailaddress=$repeatemailaddress)
if ($password==$repeatpassword&&$emailaddress==$repeatemailaddress)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)