The error code "You cant sign up at this time, try again later" keeps popping up anytime anyone tries so register. What could be wrong?
0){
while($result = mysqli_fetch_assoc($run_query334)){
$who = $result['username'];
}
}else{
header("location: index.php");
}
}else{
$who = "none";
}
?>
0){
$message_failure = "Registration failed try again";
}else{
$query1 = "SELECT * FROM registration WHERE email = '{$email}'";
$run_query1 = mysqli_query($connection, $query1);
if(mysqli_num_rows($run_query1) > 0){
$message_failure = "Email already exists";
}else{
$query22 = "SELECT * FROM registration WHERE username = '{$username}'";
$run_query22 = mysqli_query($connection, $query22);
if(mysqli_num_rows($run_query22) > 0){
$message_failure = "Username already exists";
}else{
$query55 = "INSERT INTO registration (first_name,last_name,email,password,user_pass,phone,referal,username,wallet,who_refered,reg_date,reg_time,block) VALUES ('{$fname}','{$lname}','{$email}','{$password}','{$pass}','{$phone}','{$rand4}','{$username}','{$rand}','{$who}','{$reg_date}','{$time2}','{$block}')";
$run_query55 = mysqli_query($connection, $query55);
if($run_query55 == true){
$query = "UPDATE registration SET status = '{$online}' WHERE email = '{$email}'";
$run_query = mysqli_query($connection, $query);
$query578 = "SELECT * FROM registration WHERE email = '{$email}' AND username = '{$username}'";
$run_query578 = mysqli_query($connection, $query578);
$subject = "Account Opening Notification";
require'phpmailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->Host='smtp.godaddy.com';
$mail->Port=465;
$mail->SMTPAuth=true;
$mail->SMTPSecure='ssl';
$mail->Username='username';
$mail->Password='password';
$mail->setFrom('support@site.com', 'site');
$mail->addAddress($email);
$mail->addReplyTo('support@site.com', 'site');
$mail->isHTML(true);
$mail->Subject='Welcome:'.$subject;
$mail->Body='
Dear '.$username.',
You have successfully created an account with the worlds leading company
we anticipate walking along this great path with you
© Copyright '.$date78.' All rights Reserved.
';
if(!$mail->send()){
$message_failure = "Registration not successful";
}else{
while($result = mysqli_fetch_assoc($run_query578)){
$user_id = $result['id'];
$_SESSION['user_id']= $user_id;
header("location: user_dashboard.php?p=dashboard");
/*$message = "You have successfully created your account, Check your email to activate your account";
header("location: login.php");*/
}
}
}else{
$message_failure = "You cant sign up at this time, try again later";
}
}
}
}
}
?>
What I have tried:
I have virtually anything I could think of. Right now I'm feeling dejected. Need your help guys!