I want to use my signup for to my site, but I want to check one of the entries to match a 4 digit code.
This is just the entry code, I have a input box above for all of the sign-up info, including the 'code'. I want the code to be 2369 for now, so code == 2369 is the only way it'll allow them to signup.
<?
}
\\else
{
// includes
include("dbconex.php");
// set up error list array
$errorList = array();
$count = 0;
// validate text input fields
if (!$username) { $errorList[$count] = "Invalid entry: Username"; $count++; }
// check for errors
// if none found...
if (sizeof($errorList) == 0)
{
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
// generate and execute query
$db_password = md5($password);
$query = "INSERT INTO users(username, PASSWORD, decrypted_password, email, code) VALUES('$username', '$db_password', '$password', '$email', '$code')";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// print result
echo "<font class='style6'>You have successfully signed up for the fan club. <a href='index.php'>Go back to the control panel menu</a>.</font>";
// close database connection
mysql_close($connection);
}
else
{
// errors found
// print as list
echo "<font size=-1>The following errors were encountered: <br>";
echo "<ul>";
for ($x=0; $x<sizeof($errorList); $x++)
{
echo "<li>$errorList[$x]";
}
echo "</ul></font>";
}
}
?>