plik register.php
<?php include("head.php"); ?>
Jakis teskt, ze bedzie wysylalo na e-mail ;p
<?php
print " <b>$nump</b> people already have."; ?>
<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>
<?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
$action =$_GET['action'];
if ($action == 'register') {
if (!$user || !$email || !$vemail ) {
print "You must fill out all fields."; include("foot.php");
}
if ($dupe1 > 0) {
print "Someone already has that username."; include("foot.php");
}
if ($dupe2 > 0) {
print "Someone already has that email."; include("foot.php");
}
if ($email != $email) {
print "The emails do not match."; include("foot.php");
}
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 p
laying at $gamename. Webmaster";
mysql_query("insert into players (user, email, pass) values('$user','$email','$pass')") or
die("Could not register."); mail("$email", "$gamename", $message, "From: webmaster@{$_SERVER['SERVER_NAME']}r\n"
."Reply-To: webmaster@{$_SERVER['SERVER_NAME']}r\n"
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>"; }
?>
<?php include("foot.php"); ?>