Well this is my register form, it all worked fine before but for some reason it isn't inserting anything into the table, all of my other scripts that insert items into a table.
A quick reply would be nice :) thank you.
Here is the Register Script:
<?php $title = "BlabSpot - Register"?>
<?php require("styles/top.php") ?>
<div id='full'>
<?php
if ($_POST['submitbtn']){
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password'];
$repassword = $_POST['repassword'];
$website = $_POST['website'];
$youtube = $_POST['youtube'];
$bio = $_POST['bio'];
$name = $_FILES['avatar']['name'];
$type = $_FILES['avatar']['type'];
$size = $_FILES['avatar']['size'];
$tmpname = $_FILES['avatar']['tmp_name'];
$ext = substr($name, strrpos($name, '.'));
if($firstname && $lastname && $username && $email && $password & $repassword){
if($password == $repassword){
if(strstr($email, "@") && strstr($email, ".") && (strlen($email) >= 6)){
require("scripts/connect.php");
$query = mysql_query("SELECT * FROM users WHERE username='$username'");
$numrows = mysql_num_rows($query);
if($numrows == 0){
$query = mysql_query("SELECT * FROM users WHERE email='$email'");
$numrows = mysql_num_rows($query);
if($numrows == 0){
$pass = SHA1(md5(md5($password)));
$date = date("F d, Y");
if($name){
move_uploaded_file($tmpname, "avatars/$username.$ext");
$avatar = "$username.$ext";
}
else
$avatar = "default01.jpg";
$code = substr(SHA1(rand(11111111111111, 99999999999999)), 2, 25);
mysql_query("INSERT INTO users VALUES('', '$firstname', '$lastname', '$username', '$email', '$pass', '$avatar', '$bio', '$website', '$youtube', '', '0', '$code', '0', '$date')");
$webmaster = "technicdelusion@gmail.com";
$subject = "Activate your account at Blabspot.tk";
$headers = "From: Jerome<$webmaster>";
$message = " Welcome to Blabspot $firstname \n\n To Login on our site you must first activate your account. \n\n To do so please follow link below: \n http://www.blabspot.net46.net/activate.php?code=$code \n\n If the link is broken please navigate to www.blabspot.net46.net/activate.php And use the activation code $code \n\n\n NOTE: You will not be able to login if you don't activate your email.";
mail($email, $subject, $message, $headers);
echo "Thank You for registering to Blabspot.TK . To login you must activate your account. We have sent an email to <b>$email</b> with instructions on how to do this. if you have any problems please email the site admin at $webmaster.";
}
else
echo "That email is use by another account. $register";
}
else
echo "That username is already taken. Please Choose another. $register";
}
else
echo"you did not enter a valid email. $register";
}
else
echo"Your passwords did not match. $register";
}
else
echo"You did not fill in all the required feilds. $register";
}
else
echo "$register";
?>
</div>
<?php require("styles/bottom.php") ?>