12-13-2013, 04:45 PM
$ip = "127.0.0.1"; //ðôрõÑÂ
$sqluser = "root";//ю÷õр
$sqlpw = "";//ÿðрþûь
$userdb = "newproject_db_auth"; //ñð÷ð
$skype = lc.doctor;
//Save PW in plain text? yes = on, no = off
$plain = "no";
$salt = "phoohie1yaihooyaequae7PuiWoeNgahjieth3ru3yeeghaepahb7aeYaipe2we6zii6mai6uweig8siasheinoungeoyeiLohShi2xoh2xi8ooxee9ahpiehahc9Phe";
function clean_str($str) { $str = @trim($str);
if(get_magic_quotes_gpc()) {
$str = stripslashes($str); }
$str = mysql_real_escape_string($str);
$str = preg_replace("/[^a-zA-Z0-9@.]/" , "" , $str);
return $str;}If (isset($_POST[username])){
if (empty($_POST[username]) OR empty($_POST[password]) OR empty($_POST[password2]) OR empty($_POST[email])) {
echo "Þôýþ øûø ýõÑÂúþûьúþ ÿþûõù ÿуÑÂтыõ"; ?>
setTimeout("location.href=register.php",5000);
die;}
$user = htmlspecialchars(strtolower($_POST[username]));
$pass = htmlspecialchars(clean_str($_POST[password]));
$pass2 = htmlspecialchars(clean_str($_POST[password2]));
$email = htmlspecialchars(clean_str($_POST[email]));
If ($pass != $pass2){ echo "ßðрþûø ýõ ÑÂþòÿðôðют";
?>
setTimeout("location.href=register.php",5000);
die;}
$conn = new mysqli($ip,$sqluser,$sqlpw,$userdb);
if (mysqli_connect_errno() == 0){
$qusr = "SELECT * FROM bg_user WHERE user_id = ".$user.";";
$resusr = $conn->query($qusr); If ($resusr->num_rows > 0) {
echo "Þшøñúð.ôðýýþõ øüѠуöõ ÷ðýÑÂтþ."; ?>
setTimeout("location.href=register.php",5000);
die;}
$qmail = "SELECT * FROM bg_user WHERE email = $email";
$mailres = $conn->query($qmail);
if ($mailres->num_rows > 0){
echo "Þшøñúð.ýð ÑÂтþт email уöõ ÷ðрõóøÑÂтрøрþòðýð учõтýðѠ÷ðÿøÑÂÑŒ";
?>
setTimeout("location.href=register.php",5000);
die;}
$realpass = md5($pass);
If ($plain == "no"){
$insertusr = "INSERT INTO bg_user (user_id, passwd, email) VALUES (?, ?, ?)";
$qInsert = $conn->prepare ($insertusr);
$qInsert->bind_param("sss",$user,$realpass,$email);
$qInsert->execute();
if ($qInsert->affected_rows == 1){
echo "ãÑÂÿõшýþ "; ?>
setTimeout("location.href=register.php",5000);
die;}
else;{
echo "Þшøñúð. 2";
die;
?>
}}
elseif ($plain == "yes");{
$insertusr = "INSERT INTO bg_user (user_id, truepasswd, passwd, email) VALUES (?, ?, ?, ?)";
$qInsert = $conn->prepare ($insertusr);
$qInsert->bind_param("ssss",$user,$pass,$realpass,$email);
$qInsert->execute(); if ($qInsert->affected_rows == 1){ echo "Òðш ðúúðуýт уÑÂÿõшýþ ÷ðрõóøÑÂтрøрþòðý.";
?>
setTimeout("location.href=register.php",5000);
×ðôðть òþÿрþÑÂ."; ?>
die;
Ûþóøý:
ßðрþûь:
ßðрþûь(ßþòтþр):
Email:
;}?>

