Hey, guys. I'm building a really simple member register / login, based off some other code. I added it to the server and set up the DB properly, and now I'm having an issue. Whenever I go to register a new user, it says the user field is not filled out. (Obviously, I put a detection system into place). However, it's also giving me an error in one of those areas. Obviously the string isn't being filled properly, but I can't figure out why.... here's the code for what I call the "process" part of it:
// EDIT THIS IF YOU MODIFIED THE SIGNUP PAGE OR
// IF YOU ARE USING YOUR OWN SIGNUP FORM
// We use the addslashes() function on some variables to prevent SQL Injection
$uname = addslashes($_POST['username']);
$email = addslashes($_POST['email']);
$password = $_POST['password'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$mname = $_POST['mname'];
$dob = $_POST['dob'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zipcode = $_POST['zipcode'];
$license = $_POST['license'];
$carmake = $_POST['carmake'];
$carmodel = $_POST['carmodel'];
$engine = $_POST['engine'];
$class = $_POST['class'];
$doc = $_POST['doc'];
$docnum = $_POST['docnum'];
$primecon = $_POST['primecon'];
$primecon = $_POST['primeconrel'];
$primeconnum = $_POST['primeconnum'];
$seccon = $_POST['seccon'];
$seccon = $_POST['secconrel'];
$secconnum = $_POST['secconnum'];
// SIGNUP SETTINGS
$qSetup = mysql_query("SELECT * FROM signupsetup");
$SetupRow = mysql_fetch_array($qSetup);
$ValidEmailDomains = $SetupRow['validemail'];
$profile = $SetupRow['profile'];
$defaultgroup = $SetupRow['defaultgroup'];
$defaultlevel = $SetupRow['defaultlevel'];
$AutoApprove = $SetupRow['autoapprove'];
$AutoSend = $SetupRow['autosend'];
$AutoSendAdmin = $SetupRow['autosendadmin'];
// EMAILER SETTINGS
$qEmailer = mysql_query("SELECT * FROM emailer WHERE profile='$profile'");
$EmailerRow = mysql_fetch_array($qEmailer);
$EmailerName = $EmailerRow["name"];
$EmailerFrom = $EmailerRow["email"];
$EmailerSubject = $EmailerRow["subject"];
$EmailerMessage = $EmailerRow["emailmessage"];
// SIGNUP FORM PROCESSING
$EmailQuery = mysql_query("SELECT * FROM signup WHERE email='$email'");
$email = strtolower($email);
$EmailExist = mysql_num_rows($EmailQuery); // Returns 0 if not yet existing
$username = strtolower($username);
$UsernameQuery = mysql_query ("SELECT * FROM signup WHERE username='$uname'");
$UsernameExist = mysql_num_rows($UsernameQuery);
if (trim($ValidEmailDomains)=="")
{
$EmailArray = "";
}
else
{
$EmailArray = split (" ", $ValidEmailDomains);
}
// Generate confirmation key for settings which require one
$confirmkey = md5(uniqid(rand()));
// CHECK FOR RESERVED USERNAMES
if (trim($username)=='sa' || trim($username)=='admin' || trim($username)=='test')
{
$UsernameExist = 1;
}
// CHECK FOR REQUIRED FIELDS
if (empty($username))
{
print "<p><font size=\"3\" face=\"Verdana, Arial\" color=\"#FF0000\"><b>Username field cannot be left blank!</b></font></p>";
exit;
}
On the registration form, the Username is under the name uname.
Any help would be great!
EDIT: I changed the name to uname on the registration page, and it fixed the 'error on line 68' issue I was getting.
However, I'm still getting 'username not filled out'.