پلاگین وکد خام ثبت نام کاربر قانون پلیس فتا

به ادامه مطلب بروید

کدphp:
<head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head>
<title>ثبت نام</title>
<link rel="stylesheet" href="http://ifont.ir/apicode/38">
<style type="text/css">body{font-family:tahoma;color:#111;margin:0;direction:rtl;}
body, div, h1, h2, h3, h4, h5, h6, p, a, img{margin:0px;padding:0px;}
.td-c{font-family:B yekan;font-size:13px;}
.tab-c{padding-top:9px;padding-right:9px;text-shadow:1px 1px #fff;}
.input-c{border:none;width:185px;height:27px;border:1px solid #CCC;border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;border-top-right-radius:0px;-webkit-border-top-right-radius:0px;-moz-border-top-right-radius:0px;border-bottom-right-radius:0px;-webkit-border-bottom-right-radius:0px;-moz-border-bottom-right-radius:0px;font-family:'B yekan'arial;padding-right:6px;}
.sum-c{display:inline;font-family:B yekan;font-size:13px;border-radius:7px;-webkit-border-radius:7px;-moz-border-radius:7px;border:none;box-shadow:inset 0 0 10px #ffa200;-webkit-box-shadow:inset 0 0 10px #ffa200;-moz-box-shadow:inset 0 0 10px #ffa200;background:#ffcd00;height:31px;text-shadow:0px 1px 0px #fff;-webkit-text-shadow:0px 1px 0px #fff;-moz-text-shadow:0px 1px 0px #fff;}
.sum-c:hover{background:#ffb200;text-shadow:0px 1px 0px #fff;-webkit-text-shadow:0px 1px 0px #fff;-moz-text-shadow:0px 1px 0px #fff;}</style>
</head>
<body>
<center>
<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="fa">
</head>
<?php
require('config.php');
try{
$conn = new PDO("mysql:host=$sqlhost;dbname=$database",$sqluser,$sqlpass);
}catch(PDOException $err){
exit($err->getCode().", Unable To Connect Database : ".$err->getMessage());
}
if(isset($_POST['username']) && !empty($_POST['username']) && !empty($_POST['pw1']) && !empty($_POST['pw2']) && !empty($_POST['number']) && !empty($_POST['email'])){
if($_POST['pw1']==$_POST['pw2']){
if(strlen($_POST['number'])==10){
if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)){
$getusername = $conn->query("select * from db1_etchat_user where etchat_username='".$_POST['username']."' and etchat_userprivilegien!='gast' and etchat_userprivilegien!='system'");
$num = $getusername->rowCount();
if($num > 0){
echo "<script>alert('این نام کاربری از قبل ثبت شده است!');</script>";
}else{
$gastcheck = $conn->query("select * from db1_etchat_user where etchat_username='".$_POST['username']."' and etchat_userprivilegien='gast'");
$numgast = $gastcheck->rowCount();
if($numgast > 0){
$emailcheck = $conn->query("select * from db1_etchat_user where etchat_username='".$_POST['username']."' and email='".$_POST['email']."'");
$nummail = $emailcheck->rowCount();
if($nummail > 0){
echo "<script>alert('این ایمیل از قبل توسط کاربر دیگری ثبت شده است.');</script>";
}else{
$gastupdate = $conn->prepare("UPDATE db1_etchat_user SET etchat_userpw=:pass, email=:mail, number=:number, etchat_userprivilegien='user' where etchat_username=:username");
$update = $gastupdate->execute(array(
":pass" => md5($_POST['pw1']),
":mail" => $_POST['email'],
":number" => "0".$_POST['number'],
":username" => $_POST['username']
));
if($update)
exit("ثبت نام شما با موفقیت انجام شد!");
else
echo "<script>alert('خطایی هنگام ثبت نام رخ داده است.');</script>";
}
}else{
$emailcheck = $conn->query("select * from db1_etchat_user where etchat_username='".$_POST['username']."' and email='".$_POST['email']."'");
$nummail = $emailcheck->rowCount();
if($nummail > 0){
echo "<script>alert('این ایمیل از قبل توسط کاربر دیگری ثبت شده است.');</script>";
}else{
$userinsert = $conn->prepare("INSERT INTO db1_etchat_user (etchat_username, etchat_userpw, etchat_userprivilegien, email, number) VALUES (:username, :pass, 'user', :mail, :number)");
$update = $userinsert->execute(array(
":pass" => md5($_POST['pw1']),
":mail" => $_POST['email'],
":number" => "0".$_POST['number'],
":username" => $_POST['username']
));
if($update)
exit("ثبت نام شما با موفقیت انجام شد!");
else
echo "<script>alert('خطایی هنگام ثبت نام رخ داده است.');</script>";
}
}
}
}else{
echo "<script>alert('ایمیل وارد شده صحیح نمیباشد!');</script>";
}
}else{
echo "<script>alert('تلفن همراه باید بدون صفر اول وارد شود و تعداد ارقام نباید بیشتر یا کمتر از 10 عدد باشد');</script>";
}
}else{
echo "<script>alert('رمز های وارد شده با یکدیگر برابر نیستند!');</script>";
}
}
?>
<style>
strong{
color:red;
}
</style>
<form name='register' action='' method="post">
<label for='username'>
نام کاربری <strong>*</strong>
<input type='text' name='username' id='username' maxlength="25" placeholder='نام کاربری خود را وارد کنید' required/><br />
</label>
<label for='pw1'>
رمز عبور <strong>*</strong>
<input type='password' name='pw1' id='pw1' placeholder='رمز عبور خود را وارد کنید' required/><br />
</label>
<label for='pw2'>
تکرار رمز عبور <strong>*</strong>
<input type='password' name='pw2' id='pw2' placeholder='رمز عبور خود را دوباره وارد کنید' required/><br />
</label>
<label for='number'>
تلفن همراه <strong>*</strong>
<input type='text' name='number' id='number' maxlength="10" placeholder='تفن همراه : 9351234560' required/><br />
</label>
<label for='email'>
ایمیل <strong>*</strong>
<input type='email' name='email' id='email' maxlength="500" placeholder='ایمیل خود را وارد کنید' required/><br />
</label>
<input type='submit' name='submit' id='submit' value='ثبت نام' />
</form>
- 04 اردیبهشت 1393
- 0 دیدگاه
- 13008 بازدید