I was making all the checks for the my sign up form and while checking if the length of the field is not bigger than a number, it gave me an error. Not to sure whats 'unexpected' here.
The problem is probably staring at me in the face, but I can't figure it out right now.
This is the error I received:
Parse error: syntax error, unexpected '!' in C:\users\user\xampp\htdocs\CompanyProject\Signup.php on line 15
This is the PHP code I used for to accomplish what I wanted to do:
if($password == $confirmpass){
if(!empty($password) AND !empty($username) AND !empty($email)){
if (strlen($username) >=3 && strlen(trim($username)) !== 0 && strlen($password) >=3 && strlen(trim($password)) !== 0 && strlen($email) >=3 && strlen(trim($email)) !== 0) {
if(strlen($username) !<13){
if(strlen($password) !<17){
$sql ="INSERT INTO users(user,pass,email) VALUES('".$username."','".md5($password)."','".$email."')";
mysql_query($sql);
header('Location: Login.php');
}else{
echo "Your password must be between 3 and 17 characters"
}
}else{
echo "Your username must be between 3 and 13 characters."
}
}else{
echo "Each field needs atleast 3 characters.";
}
}else{
echo "Please fill out the form.";
}
}else{
echo ("Your passwords do not match");
}
}
The error is occuring in these lines:
if(strlen($username) !<13){
if(strlen($password) !<17){
Thanks in advance.