Onbekend |
|
hallo, ik ben bezig aan een rpg game (geen criminals!!) maar kheb een vraagje, als je een bepaald type selecteer moet hij in een bepaald land starten
BV: selecteer je type 1 start hij in land 1, selecteer je type 2 start hij in land 2, stanaard start je in land 1
<?
ob_start();
?>
<?php
include("_include-config.php");
if($data->level == 1) {
print " <tr><td class=\"mainTxt\"><font color=\"red\">Je bent al lid.</font></td></tr>\n";
exit; }
if($data->level == 255) {
print " <tr><td class=\"mainTxt\"><font color=\"red\">Je bent al lid, meer bepaald admin zelf.</font></td></tr>\n";
exit; }
if($data->level == 100) {
print " <tr><td class=\"mainTxt\"><font color=\"red\">Je bent al lid, meer bepaald een hacker.</font></td></tr>\n";
exit; }
if($data->level == 2) {
print " <tr><td class=\"mainTxt\"><font color=\"red\">Je bent al lid, meer bepaald een hacker.</font></td></tr>\n";
exit; }
if($data->level == 10) {
print " <tr><td class=\"mainTxt\"><font color=\"red\">Je bent al lid, meer bepaald een hacker.</font></td></tr>\n";
exit; }
$login = $_POST['login'];
$pass = $_POST['pass'];
$passconfirm = $_POST['passconfirm'];
$email = $_POST['email'];
$type = $_POST['type'];
$IP = $_SERVER['REMOTE_ADDR'];
${"select$type"} = "selected";
if(isset($_POST['submit'])) {
$message = Array(
"Je login mag alleen A-Z, a-z, 0-9, _ en - hebben",
"De wachtwoorden die je gaf zijn niet identiek",
"Vul een geldig e-mail adres in",
"Selecteer een type",
"Er bestaat al iemand met die login",
"Er is al iemand met die e-mail");
$msgnum = -1;
if(preg_match('/^[a-zA-Z0-9_\-]+$/',$login) == 0)
$msgnum = 0;
if($pass == "" || $pass != $passconfirm)
$msgnum = 1;
if(preg_match('/^.+@.+\..+$/',$email) == 0)
$msgnum = 2;
if($type != 1 && $type != 2 && $type != 3)
$msgnum = 3;
else {
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `login`='$login'");
if(mysql_num_rows($dbres) > 0)
$msgnum = 4;
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `email`='$email'");
if(mysql_num_rows($dbres) > 0)
$msgnum = 5;
if($msgnum == -1) {
$code = rand(100000,999999);
mysql_query("INSERT INTO `[users]`(signup,login,pass,IP,email,type) values(NOW(),'$login',MD5('$pass'),'$IP','$email',$type)");
mysql_query("INSERT INTO `[temp]`(login,IP,code,area,time) values('$login','$IP',$code,'signup',NOW())");
$id = mysql_insert_id();
$dbres = mysql_query("SELECT `login` FROM `[temp]` WHERE `area`='signup' AND `id`='$id' AND `code`='$code'");
}
}
}
?>
<html>
<head>
<title><--counter terrors--></title>
<link rel="stylesheet" type="text/css" href="css-v1.css">
</head>
<body style="margin: 0px;">
<table align="center" width=100%>
<?php
if($msgnum != -1) {
print " <tr><td class=\"subTitle\"><b>Aanmelden</b></td></tr>\n";
if(isset($msgnum) && $msgnum != -1)
print " <tr><td class=\"mainTxt\">\n {$message[$msgnum]}\n </td></tr>\n";
$rec = $_GET['rec'];
?>
<tr><td class="mainTxt">
<b> Alstublieft een aanmelding per persoon. </b>
<form method="post"><table align="center">
<tr><td width=100>Login:</td> <td><input type="text" name="login" maxlength=16 style="width: 150;" value="<? echo $login ?>"><b>Min. 3 tekens</b></td></tr>
<tr><td width=100>Wachtwoord:</td> <td><input type="password" name="pass" maxlength=16 style="width: 150;"></td></tr>
<tr><td width=100>Herhaal:</td> <td><input type="password" name="passconfirm" maxlength=16 style="width: 150;"></td></tr>
<tr><td width=100>E-Mail:</td> <td><input type="text" name="email" maxlength=64 style="width: 150;" value="<? echo $emaill ?>"></td></tr>
<tr><td width=100>Type:</td> <td><select name="type" style="width: 150;">
<option value="1" $select1>Warrior</option>
<option value="2" $select2>Magician</option>
<option value="3" $select3>Priest</option>
<option value="4" $select3>Rogue</option>
</select> <a href="javascript: //" onClick="window.open('help.php#types')">[?]</a></td></tr>
</td></tr>
<tr><td></td><td align="right"><input type="submit" name="submit" style="width: 100;" value="Aanmelden"></td></tr>
</table></form><br>
</td></tr>
<?
}
else
print " <tr><td class=\"mainTxt\">Je bent geregistreerd. Je kunt nu inloggen.</td></tr>\n";
}
?>
</table>
</body>
</html>
<? mysql_close(); ?>
<? ?> <?php include("_include-config.php"); if($data->level == 1) { print " <tr><td class=\"mainTxt\"><font color=\"red\">Je bent al lid.</font></td></tr>\n"; if($data->level == 255) { print " <tr><td class=\"mainTxt\"><font color=\"red\">Je bent al lid, meer bepaald admin zelf.</font></td></tr>\n"; if($data->level == 100) { print " <tr><td class=\"mainTxt\"><font color=\"red\">Je bent al lid, meer bepaald een hacker.</font></td></tr>\n"; if($data->level == 2) { print " <tr><td class=\"mainTxt\"><font color=\"red\">Je bent al lid, meer bepaald een hacker.</font></td></tr>\n"; if($data->level == 10) { print " <tr><td class=\"mainTxt\"><font color=\"red\">Je bent al lid, meer bepaald een hacker.</font></td></tr>\n"; $login = $_POST['login']; $pass = $_POST['pass']; $passconfirm = $_POST['passconfirm']; $email = $_POST['email']; $type = $_POST['type']; $IP = $_SERVER['REMOTE_ADDR']; ${"select$type"} = "selected"; if(isset($_POST['submit'])) { "Je login mag alleen A-Z, a-z, 0-9, _ en - hebben", "De wachtwoorden die je gaf zijn niet identiek", "Vul een geldig e-mail adres in", "Selecteer een type", "Er bestaat al iemand met die login", "Er is al iemand met die e-mail"); $msgnum = -1; $msgnum = 0; if($pass == "" || $pass != $passconfirm) $msgnum = 1; $msgnum = 2; if($type != 1 && $type != 2 && $type != 3) $msgnum = 3; else { $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `login`='$login'"); $msgnum = 4; $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `email`='$email'"); $msgnum = 5; if($msgnum == -1) { $code = rand(100000,999999); mysql_query("INSERT INTO `[users]`(signup,login,pass,IP,email,type) values(NOW(),'$login',MD5('$pass'),'$IP','$email',$type)"); mysql_query("INSERT INTO `[temp]`(login,IP,code,area,time) values('$login','$IP',$code,'signup',NOW())"); $dbres = mysql_query("SELECT `login` FROM `[temp]` WHERE `area`='signup' AND `id`='$id' AND `code`='$code'"); } } } ?> <html> <head> <title><--counter terrors--></title> <link rel="stylesheet" type="text/css" href="css-v1.css"> </head> <body style="margin: 0px;"> <table align="center" width=100%> <?php if($msgnum != -1) { print " <tr><td class=\"subTitle\"><b>Aanmelden</b></td></tr>\n"; if(isset($msgnum) && $msgnum != -1) print " <tr><td class=\"mainTxt\">\n {$message[$msgnum]}\n </td></tr>\n"; $rec = $_GET['rec']; ?> <tr><td class="mainTxt"> <b> Alstublieft een aanmelding per persoon. </b> <form method="post"><table align="center"> <tr><td width=100>Login:</td> <td><input type="text" name="login" maxlength=16 style="width: 150;" value=" <? echo $login ?>"><b>Min. 3 tekens</b></td></tr> <tr><td width=100>Wachtwoord:</td> <td><input type="password" name="pass" maxlength=16 style="width: 150;"></td></tr> <tr><td width=100>Herhaal:</td> <td><input type="password" name="passconfirm" maxlength=16 style="width: 150;"></td></tr> <tr><td width=100>E-Mail:</td> <td><input type="text" name="email" maxlength=64 style="width: 150;" value=" <? echo $emaill ?>"></td></tr> <tr><td width=100>Type:</td> <td><select name="type" style="width: 150;"> <option value="1" $select1>Warrior</option> <option value="2" $select2>Magician</option> <option value="3" $select3>Priest</option> <option value="4" $select3>Rogue</option> </select> <a href="javascript: //" onClick="window.open('help.php#types')">[?]</a></td></tr> </td></tr> <tr><td></td><td align="right"><input type="submit" name="submit" style="width: 100;" value="Aanmelden"></td></tr> </table></form><br> </td></tr> <? } else print " <tr><td class=\"mainTxt\">Je bent geregistreerd. Je kunt nu inloggen.</td></tr>\n"; } ?> </table> </body> </html>
|