When you register at the game im working on, i want you to be able to pick your specie and gender, so your characters picture will be dependent on that.
It works, but it doesnt add the gender or specie fields into the database. Also i wanted to know if i could have a pic beside the drop down list to show what the specie looks like.
<form method=post action=register.php?action=register>
<table>
<tr><td>Username:</td><td><input type=text name=user></td></tr>
<tr><td>Email:</td><td><input type=text name=email></td></tr>
<tr><td>Verify Email:</td><td><input type=text name=vemail></td></tr>
<tr><td>Gender:</td><td><select name=type id=gender><option value=Male>Male</option><option value=Female>Female</option></select></td></tr>
<tr><td>Specie:</td><td><select name=type id=specie><option value=Human>Human</option><option value=Hounzalid>Hounzalid</option></select></td></tr>
<?php
print "<tr><td>Referral ID:</td><td><input type=text name=ref readonly value=$ref> <i>If you don't know what this is, leave it blank.</i></td></tr>";
?>
<tr><td colspan=2 align=center><input type=submit value=Register></td></tr>
</form>
<?php
if ($action == register) {
if (!$user || !$email || !$vemail ) {
print "You must fill out all fields.";
include("foot.php");
exit;
}
$dupe1 = mysql_num_rows(mysql_query("select * from players where user='$user'"));
if ($dupe1 > 0) {
print "Someone already has that username.";
include("foot.php");
exit;
}
$dupe2 = mysql_num_rows(mysql_query("select * from players where email='$email'"));
if ($dupe2 > 1) {
print "Someone already has that email.";
include("foot.php");
exit;
}
if ($email != $email) {
print "The emails do not match.";
include("foot.php");
exit;
}
$ref = strip_tags($ref);
$user = strip_tags($user);
$pass = strip_tags($pass);
$gender = strip_tags($gender);
$specie = strip_tags($specie);
if ($ref) {
mysql_query("update players set refs=refs+1 where id=$ref");
}
$pass = rand(10000 , 90000);
$message = "welcome to $gamename your pass is $pass login now and change it. have fun playing at $gamename. Webmaster";
mysql_query("insert into players (user, email, pass, gender, specie) values('$user','$email','$pass','$gender','$specie')") or die("Could not register.");
mail("$email", "$gamename", $message,
"From: webmaster@{$_SERVER['SERVER_NAME']}\r\n"
."Reply-To: webmaster@{$_SERVER['SERVER_NAME']}\r\n"
."X-Mailer: PHP/" . phpversion()) or die("could not send mail");
print "You are now registered to play, $user. Please check your e-mail for your pass and login now.";
print "<br><a herf=index.php>login</a>";
}
?></table>
<?php include("footer1.php"); ?>
Thanks for any help.
-Dusk