Register Básicão Mesmo em PHP
Obs: Para Criar Seu Código em PHP , Abra Bloco de Notas , Salvar Como , Exemplo : Register.php e Salve !
Créditos : RazeZones
Obs: Para Criar Seu Código em PHP , Abra Bloco de Notas , Salvar Como , Exemplo : Register.php e Salve !
- Código:
<html>
<head>
<title>RF-Online Register Site</title>
</head>
<body>
<?php
$this_page = "register.php";
$user = "sa"; //SQL User
$pass = "0000"; //SQL Password
$host = "127.0.0.1";
$db = "rf_account"; //Datenbank
$Max = "1000"; //Maximum number of players, who may register on the server
$Max2 = $Max - 1;
mssql_connect($host, $user, $pass)
or die("There have been happend an error. Please contact an Admin. ( Error 3 )");
mssql_select_db($db)
or die("There have been happend an error. Please contact an Admin. ( Error 4 )");
if($register==1)
{
if(strlen($name) < 3)
{
$wrong = "The Loginname must be long at least 4 indications.<br/>";
**
if(strlen($pass1) < 4 || strlen($pass1) > 10)
{
$wrong .= "The password must contain 4 to 10 indications.<br/>";
**
if(!$wrong)
{
$resql = "SELECT * FROM tbl_DevAccount WHERE id = '$name'";
$reresult = @mssql_query($resql);
$reresult2 = @mssql_num_rows($reresult);
if($reresult2!="")
{
$wrong .= "Your Account Name assigned. Please choose an other account name.<br/>";
**
**
if(!$wrong)
{
//$reg_t = @mssql_query("SELECT MAX(memb_guid) AS maxid FROM tbl_DevAccount");
//$reg_t_row = @mssql_fetch_array($reg_t);
//$reg_t_row['maxid']++;
$sql = "INSERT INTO tbl_DevAccount ("
."id,"
."pw,"
."country,"
."gehfra,"
."gehant,"
."email ) "
."VALUES ("
."'$name',"
."'$pass1',"
."'$land',"
."'$gefr',"
."'$gean',"
."'$mail' )";
@mssql_query($sql)
or die("There have been happend an error. Please contact an Admin. ( Error 1 )");
echo "Welcome at [COLOR="Lime"](Server Name)[/COLOR] . The regestration of your account has been successfully. Have fun at [COLOR="Lime"](Server Name)[/COLOR]." ;
**
**
if(!$register || $wrong)
{
$result = mssql_query("SELECT * FROM tbl_DevAccount");
$num_reg = mssql_num_rows($result);
$num_aval = $Max - $num_reg;
echo "Momentarily " . $num_reg . " users are announced.<BR>";
if ($num_reg < $Max)
{
echo " ";
echo $wrong;
?>
<form method='POST' action='<?php echo $this_page ?>'>
<table>
<tr>
<td>Loginname:</td><td><input type="text" name="name" size="16" maxLength="12"></td>
</tr>
<tr>
<td>Password:</td><td><input type="PASSWORD" name="pass1" value size="16" maxLength="12"></td>
</tr>
<tr>
<td>Password repeat:</td><td><input type="PASSWORD" name="pass2" value size="16" maxLength="12"></td>
</tr>
<tr>
<td>E-Mail:</td><td><input type="text" name="mail" value size="16" maxLength="50"></td>
</tr>
<tr>
<td>Secretly question::</td><td><input type="text" name="gefr" value size="16" maxLength="50"></td>
</tr>
<tr>
<td>Secretly answer:</td><td><input type="text" name="gean" value size="16" maxLength="50"></td>
</tr>
<tr>
<td>Country:</td><td><input type="text" name="land" value size="16" maxLength="50"></td>
</tr>
<tr>
<td colspan="2" align="right"><INPUT type='hidden' name='register' value='1'><input type="submit" value="Register"></td>
</tr>
</table></form>
<?php
**
else
{
echo "Registration at present not possible.<br/>" ;
echo "Please you try it again at a later time.<br/>" ;
**
**
mssql_close();
?>
</body>
</html>
Créditos : RazeZones