if($connection){
echo "you're successfully connected to the database";
}else{
die("<p>unable to connect to the database</p>".mysqli_error($connection));
exit();
}
$name = mysqli_real_escape_string($connection,$_POST['register']);
$email = mysqli_real_escape_string($connection,$_POST['email']);
$password = mysqli_real_escape_string($connection,$_POST['password']);
//error handling
if(empty($name)||(empty($email)||(empty($password)){
echo "None of the fields should be left empty!";
exit();
}else{
if(!preg_match("/^[a-zZ-A]*&/", $name)){
header('Location: ../products_services.php?signup=invalid');
exit();
}else{
$query = "SELECT * FROM signedup WHERE name='$name'";
mysqli_query($connection, $query);
}
}
}
?>
Please format the code you posted, by wrapping it in triple backticks. -> `
Обсуждают сегодня