include('header.php');
if ($_POST["sa"] != "I ACCEPT") {
?>
The Zbang! "episode 0" beta is now available for download to a small number of our registered users !
To receive your download link, please fill out the following details :
WriteForm(null);
?>
} else {
//var_dump($_POST);
//echo "
";
$db = mysqli_connect("localhost", "zbeng", "GAXlDEkIjIx6RUJs", "zbeng");
$BadStuff = array();
$BadStuff["username"] = $_POST["username"] == "";
$BadStuff["lastname"] = $_POST["lastname"] == "";
$BadStuff["firstname"] = $_POST["firstname"] == "";
$BadStuff["password"] = $_POST["password"] == "";
$BadStuff["password2"] = $_POST["password2"] == "";
$BadStuff["email"] = $_POST["email"] == "";
$BadStuff["InvalidPwd"] = !($_POST["password"] == $_POST["password2"]);
// if (!preg_match("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $_POST["email"])) {
$email = $_POST["email"];
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$BadStuff["InvalidEmail"] = true;
}
$checkline = "SELECT * from EngSiteUsers WHERE username = '${_POST["username"]}'";
$checkresult = mysqli_query($db,$checkline);
if (!$checkresult)
printf("%s",mysqli_error());
if (mysqli_num_rows($checkresult ) > 0) {
$BadStuff["UserTaken"]= true;
}
$anybad = false;
// check if there's any bad stuff and make anybad true
foreach ($BadStuff as $a) {
if ($a)
$anybad = true;
}
if ($anybad) {
Redify(true,"Please fill the missing or incorrent form items:");
echo "
";
WriteForm($BadStuff);
} else {
$now = date("Y-m-d H:i:s");
$entry = "INSERT into EngSiteUsers(username, firstname, lastname, password, email, city, country, hearabout, birthday, signupdate) values ('${_POST['username']}', '${_POST['firstname']}', '${_POST['lastname']}', '${_POST['password']}', '${_POST['email']}', '${_POST['city']}', '${_POST['country']}', '${_POST['hearabout']}', '${_POST['birthDay']}-${_POST['birthMonth']}-${_POST['birthYear']}', '$now')";
//printf("%s
",$entry);
$result = mysqli_query($db,$entry);
//printf("%s",$result);
if (!$result)
printf("%s",mysqli_error());
echo "Thanks for registering.
An email has been sent to you with further downloading instructions.
We hope you'll enjoy \"Zbang! Episode 0 (BETA DEMO)\"
\n";
$hash = md5($_POST["username"].'corbomite');
$confirmLink = "http://corbomitegames.com/zbang/downloadgame.php?username=${_POST["username"]}&code=$hash";
$mail_message = "
|
|
Thank you for regisering to our beta. You can go ahead and downlaod Zbang! Episode 0 (DEMO BETA) using this link: $confirmLink This is your download code to be used for downloading: $hash The Corbomite Games team. |