Auto Cubi(MySQL)
Bom vi que uma galera estava procurando um script para auto cubi mysql aqui esta.
<html>
<head>
<!-- <meta http-equiv="refresh" content="10" > -->
</head>
<body style="margin: 0;" bgcolor="#eeeeee">
<table width="80%" height="25" align="center" cellpadding="10" cellspacing="0" border="1">
<?
include "status.php";
?>
<tr>
<td align="center" valign="top">
<?
include "config.php";
$Data = '<form action=index.php method=post>
<br><br>Login:
<br><input type=text name=login><br><br>
Senha:
<br><input type=password name=passwd><br><br>
Repita a Senha:
<br><input type=password name=repasswd><br><br>
Email:
<br><input type=text name=email><br><br>
<input type=submit name=submit value="Registrar">
</form>';
if (isset($_POST['login']))
{
$Link = MySQL_Connect($DB_Host, $DB_User, $DB_Password) or die ("Can't connect to MySQL");
MySQL_Select_Db($DB_Name, $Link) or die ("Database ".$DB_Name." do not exists.");
$Login = $_POST['login'];
$Pass = $_POST['passwd'];
$Repass = $_POST['repasswd'];
$Email = $_POST['email'];
$Login = StrToLower(Trim($Login));
$Pass = StrToLower(Trim($Pass));
$Repass = StrToLower(Trim($Repass));
$Email = Trim($Email);
if (empty($Login) || empty($Pass) || empty($Repass) || empty($Email))
{
echo "<br>Por favor, Preencha todos os dados.";
}
/* elseif (ereg("[^0-9a-zA-Z_-]", $Login, $Txt))
{
echo "<br>O Login está em um formato incorreto.";
}
elseif (ereg("[^0-9a-zA-Z_-]", $Pass, $Txt))
{
echo "<br>Password have a incorrect format.";
}
elseif (ereg("[^0-9a-zA-Z_-]", $Repass, $Txt))
{
echo "<br>Repeat password have a incorrect format.";
}
*/
elseif (StrPos('\'', $Email))
{
echo "<br>O E-mail está em um formato incorreto.";
}
else
{
$Result = MySQL_Query("SELECT name FROM users WHERE name='$Login'") or ("Can't execute query.");
if (MySQL_Num_Rows($Result))
{
echo "<br>A conta <b>".$Login."</b> já existe";
}
$mal = MySQL_Query("SELECT email FROM users WHERE email='$Email'") or ("Can't execute query.");
if (MySQL_Num_Rows($mal))
{
echo "<font color=red><font color=black><br>O E-mail <b>".$Email."</b> já está cadastrado<br>";
}
elseif ((StrLen($Login) < 4) or (StrLen($Login) > 10))
{
echo "<br>O Login precisa ter mais de 4 e menos 10 carácteres.";
}
elseif ((StrLen($Pass) < 4) or (StrLen($Pass) > 10))
{
echo "<br>Password must have more 4 and not more 10 symbols.";
}
elseif ((StrLen($Repass) < 4) or (StrLen($Repass) > 10))
{
echo "<br>Repeat password must have more 4 and not more 10 symbols.";
}
elseif ((StrLen($Email) < 4) or (StrLen($Email) > 25))
{
echo "<br>Email must have more 4 and not more 25 symbols.";
}
elseif ($Pass != $Repass)
{
echo "<br>Senhas erradas.";
}
else
{
$Salt = $Login.$Pass;
$Salt = md5($Salt);
$Salt = "0x".$Salt;
MySQL_Query("call adduser('$Login', $Salt, '0', '0', '0', '0', '$Email', '0', '0', '0', '0', '0', '0', '0', '', '', $Salt)") or die ("Can't execute query.");
$result2 = mysql_query("SELECT * FROM users WHERE name='$Login'") or die("can't find ID");
$row2 = mysql_fetch_array( $result2 );
$ID = $row2['ID'];
$TIME = $row2['creatime'];
MySQL_Query("INSERT INTO usecashnow (userid, zoneid, sn, aid, point, cash, status, creatime) VALUES ($ID, 1, -1, 1, 0, 450000, 0, '$TIME')");
echo "<br>A conta <b>".$Login."</b> foi registrada.";
echo "<br>A conta <b>".$Login."</b> recebeu 4.500 cubis.";
}
}
}
echo $Data;
?>
</td>
</tr>
</table>
</body>
</html>
<head>
<!-- <meta http-equiv="refresh" content="10" > -->
</head>
<body style="margin: 0;" bgcolor="#eeeeee">
<table width="80%" height="25" align="center" cellpadding="10" cellspacing="0" border="1">
<?
include "status.php";
?>
<tr>
<td align="center" valign="top">
<?
include "config.php";
$Data = '<form action=index.php method=post>
<br><br>Login:
<br><input type=text name=login><br><br>
Senha:
<br><input type=password name=passwd><br><br>
Repita a Senha:
<br><input type=password name=repasswd><br><br>
Email:
<br><input type=text name=email><br><br>
<input type=submit name=submit value="Registrar">
</form>';
if (isset($_POST['login']))
{
$Link = MySQL_Connect($DB_Host, $DB_User, $DB_Password) or die ("Can't connect to MySQL");
MySQL_Select_Db($DB_Name, $Link) or die ("Database ".$DB_Name." do not exists.");
$Login = $_POST['login'];
$Pass = $_POST['passwd'];
$Repass = $_POST['repasswd'];
$Email = $_POST['email'];
$Login = StrToLower(Trim($Login));
$Pass = StrToLower(Trim($Pass));
$Repass = StrToLower(Trim($Repass));
$Email = Trim($Email);
if (empty($Login) || empty($Pass) || empty($Repass) || empty($Email))
{
echo "<br>Por favor, Preencha todos os dados.";
}
/* elseif (ereg("[^0-9a-zA-Z_-]", $Login, $Txt))
{
echo "<br>O Login está em um formato incorreto.";
}
elseif (ereg("[^0-9a-zA-Z_-]", $Pass, $Txt))
{
echo "<br>Password have a incorrect format.";
}
elseif (ereg("[^0-9a-zA-Z_-]", $Repass, $Txt))
{
echo "<br>Repeat password have a incorrect format.";
}
*/
elseif (StrPos('\'', $Email))
{
echo "<br>O E-mail está em um formato incorreto.";
}
else
{
$Result = MySQL_Query("SELECT name FROM users WHERE name='$Login'") or ("Can't execute query.");
if (MySQL_Num_Rows($Result))
{
echo "<br>A conta <b>".$Login."</b> já existe";
}
$mal = MySQL_Query("SELECT email FROM users WHERE email='$Email'") or ("Can't execute query.");
if (MySQL_Num_Rows($mal))
{
echo "<font color=red><font color=black><br>O E-mail <b>".$Email."</b> já está cadastrado<br>";
}
elseif ((StrLen($Login) < 4) or (StrLen($Login) > 10))
{
echo "<br>O Login precisa ter mais de 4 e menos 10 carácteres.";
}
elseif ((StrLen($Pass) < 4) or (StrLen($Pass) > 10))
{
echo "<br>Password must have more 4 and not more 10 symbols.";
}
elseif ((StrLen($Repass) < 4) or (StrLen($Repass) > 10))
{
echo "<br>Repeat password must have more 4 and not more 10 symbols.";
}
elseif ((StrLen($Email) < 4) or (StrLen($Email) > 25))
{
echo "<br>Email must have more 4 and not more 25 symbols.";
}
elseif ($Pass != $Repass)
{
echo "<br>Senhas erradas.";
}
else
{
$Salt = $Login.$Pass;
$Salt = md5($Salt);
$Salt = "0x".$Salt;
MySQL_Query("call adduser('$Login', $Salt, '0', '0', '0', '0', '$Email', '0', '0', '0', '0', '0', '0', '0', '', '', $Salt)") or die ("Can't execute query.");
$result2 = mysql_query("SELECT * FROM users WHERE name='$Login'") or die("can't find ID");
$row2 = mysql_fetch_array( $result2 );
$ID = $row2['ID'];
$TIME = $row2['creatime'];
MySQL_Query("INSERT INTO usecashnow (userid, zoneid, sn, aid, point, cash, status, creatime) VALUES ($ID, 1, -1, 1, 0, 450000, 0, '$TIME')");
echo "<br>A conta <b>".$Login."</b> foi registrada.";
echo "<br>A conta <b>".$Login."</b> recebeu 4.500 cubis.";
}
}
}
echo $Data;
?>
</td>
</tr>
</table>
</body>
</html>
Todos os Direitos Reservados a Aprendiz Perfect World.
2 comentários:
como q faz ppra coloca auto cubis q nao consegui ?
Pois eh eu tbm nao consegui por Auto cubi , da Erro .. eu Sei ki o Site tah abandonado , qlq coisa me manda a Resposta ai , ki eu ando vendo o Site
Postar um comentário