Hi guys hope your all well, im having a problem with a register page on my website, Dreamweaver is saying there are no syntax errors, but when the information gets submitted, the check page isnt doing anything :(
This is the code i have:
<?php
session_start();
include_once"includes/dbconnect.php";
if ($_POST['Submit']){
$user = $_POST['user'];
$pass = $_POST['pass'];
$email = $_POST['email1'];
$emailc = $_POST['email2'];
$month = strip_tags($_POST['month']);
$day = strip_tags($_POST['day']);
$year= strip_tags($_POST['year']);
$country = strip_tags($_POST['country']);
$today = gmdate('Y-m-d h:i:s');
$user = stripslashes($user);
$pass = stripslashes($pass);
$email = stripslashes($email);
$email1 = stripslashes($email1);
if((!$user) || (!$email) || (!$pass) || (!$email1) || (!$month) || (!$day) || (!$year) || (!$country)) {
die("Not every field was filled, go back and try again");
}else{
if ($email != $email1){
die("E-Mail addresses didnt match");
}elseif ($email == $email1){
if (ereg('[^A-Za-z0-9]', $user)) {
die("Your username can only contain letters and numbers");
}elseif (!ereg('[^A-Za-z0-9]', $user)) {
if (strlen($user) <= 3 || strlen($user) >= 20){
die("Username must be over 5 and under 30");
}elseif (strlen($user) > 5 || strlen($user) < 30){
if (strlen($pass) <= 5 || strlen($pass) >= 25) {
die("Password must be over 5 and under 25");
}elseif (strlen($pass) > 5 || strlen($pass) < 25) {
$echeck = mysql_query("SELECT email FROM users WHERE email='$email'");
$ucheck = mysql_query("SELECT username FROM users WHERE username='$user'");
$echeck1 = mysql_num_rows($echeck);
$ucheck1 = mysql_num_rows($ucheck);
if(($echeck1 > 0) || ($ucheck1 > 0)){
if($echeck1 > 0){
die("Your email address has already been used");
unset($email);
}
if($ucheck1 > 0){
die("Your desired username is already in use");
unset($user);
}
}else{
require_once('recaptchalib.php');
$privatekey = "6LdEqb8SAAAAAPpRBQdASJOswREPbwMbXn-H0yNU";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die("The reCAPTCHA wasn't entered correctly. Go back and try it again.");
} else {
if ($year != '' && $month != '' && $day != '') {
$date = $year.'-'.$month.'-'.$day;
$ip = $_SERVER['REMOTE_ADDR'];
$ver = rand(111111111,999999999);
mysql_query("INSERT INTO users (`id` , `username` , `password` , `email` , `dob` , `country` , `signupdate` , `ip` , `verifictation` , `verified`)
VALUES('' , '$user' , $pass' , '$email' , '$date' , '$country' , '$today' , '$ip' , '$ver' , 'No' ,)");
$subject = "Thank you for registering with The Music Network";
$message = "$user,
Hello $user , Almost done, just need to verify your account, here is info on how to do so.
First off, point your browser to: musicnetwork.razor-sharpdesigns.co.uk/verify.php
and enter this code: $ver
And thats all, after you can user the service fully
Login Information:
Username: $user
Password: $pass
Thanks
The Music Network Staff.
This is an automated response, please do not reply!";
mail($email, $subject, $message,
"From: The Music Network<tmn@razor-sharpdesigns.co.uk>");
$message= 'Account created, check email. ';
} }}}}}}}}
?>
Anyone got any protips?