<?phpif(file_exists('install.lock'))
header("Location: installed.php");
include("../engine/config.php");
$mysql_table = 'admin_for_index_bysb';
$success_page = './end.php';
$error_message = "";
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['form_name'] == 'signupform')
{
$newusername = $_POST['username'];
$newemail = $_POST['email'];
$newpassword = $_POST['password'];
$confirmpassword = $_POST['confirmpassword'];
$newfullname = $_POST['fullname'];
$code = 'NA';
if ($newpassword != $confirmpassword)
{
$error_message = 'رمز و تاییدیه یکی نیستند!';
}
else
if (!preg_match("/^[A-Za-z0-9_!@$]{1,50}$/", $newusername))
{
$error_message = 'نام کاربری نا معتبر است!';
}
else
if (!preg_match("/^[A-Za-z0-9_!@$]{1,50}$/", $newpassword))
{
$error_message = 'رمز نامعتبر است!';
}
else
if (!preg_match("/^[A-Za-z0-9_!@$.' &]{1,50}$/", $newfullname))
{
$error_message = 'نام کامل نامعتبر است!';
}
else
if (!preg_match("/^.+@.+\..+$/", $newemail))
{
$error_message = 'ایمیل نامعتبر است.';
}
if (empty($error_message))
{
$db = mysql_connect($mysql_server, $mysql_username, $mysql_password);
if (!$db)
{
die('Failed to connect to database server!<br>'.mysql_error());
}
mysql_select_db($mysql_database, $db) or die('Failed to select database<br>'.mysql_error());
$sql = "SELECT username FROM ".$mysql_table." WHERE username = '".$newusername."'";
$result = mysql_query($sql, $db);
if ($data = mysql_fetch_array($result))
{
$error_message = 'این نام کاربری قبلا توسط دیگری انتخاب شده است';
}
}
if (empty($error_message))
{
$crypt_pass = md5($newpassword);
$newusername = mysql_real_escape_string($newusername);
$newemail = mysql_real_escape_string($newemail);
$newfullname = mysql_real_escape_string($newfullname);
$sql = "INSERT `".$mysql_table."` (`username`, `password`, `fullname`, `email`, `active`, `code`) VALUES ('$newusername', '$crypt_pass', '$newfullname', '$newemail', 1, '$code')";
$result = mysql_query($sql, $db);
mysql_close($db);
$subject = 'Index Installed !';
ob_start(); ?>
<h2>ایمیل</h2>
<div><table cellpadding='5' cellspacing='1' style='margin-left:auto;margin-right:auto;width:100%;border:0px;font-family:tahoma;font-size:12px;direction:rtl;border:thin solid #777;'>
<tbody>
<tr>
<td style='background-color:#3a3a3a;text-align:center;font-weight:bold;color:#E0E0E0;'>کاربر عزیز اکانت آدمین شما با مشخصات زیر ساخته شد:</td>
</tr>
<tr>
<td style='background-color:#f5f5f5;padding:25px;'>
<table border='1' style='margin-left:auto;margin-right:auto;width:90%;border-collapse:collapse;border-color:#777;font-size:12px;'>
<tbody>
<tr style='background-color:#ccc;text-align:center;font-weight:bold;color:#3a3a3a;'>
<td colspan='5' style='padding:5px;'>اطلاعات ورود شما</td>
</tr>
<tr style='background-color:#ccc;text-align:center;color:#3a3a3a;'>
<td width='15%' style='padding:5px;'>نام اکانت</td>
<td width='15%'>رمز عبور</td>
<td width='25%'>آدرس پنل</td>
</tr>
<tr style='text-align:center;font-weight:bold;'>
<td style='padding:15px 0;'><?php echo $newusername ?></td>
<td><?php echo $newpassword ?></td><td><?php echo "http://www.YOURSITE/panel" ?></td>
</tr></tbody>
</table>
<br><br>
از این پس میتوانید به ورود به آدرس زیر به مدیریت ایندکس خود بپردازید :<br><br>
درصورتی که مشکلی با ایندکس داشتید با ما در تماس باشید<br>
taghilolo@yahoo.com
</div>
<?php
$message = ob_get_clean();
ob_end_clean();
$message = html_entity_decode($message);
$header = "From: Administor INDEX"."\r\n";
$header .= "Reply-To: taghilolo@yahoo.com"."\r\n";
$header .= "MIME-Version: 1.0"."\r\n";
$header .= "Content-Type: text/plain; charset=utf-8"."\r\n";
$header .= "Content-Transfer-Encoding: 8bit"."\r\n";
$header .= "X-Mailer: PHP v".phpversion();
mail($newemail, $subject, $message, $header);
header('Location: '.$success_page);
exit;
}
}
?>
<!doctype html>
<html dir="rtl">
<head>
<title>وارد کردن اطلاعات آدمین</title>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="imagetoolbar" content="no" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="content-language" content="en" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body class="v35 webkit chrome login">
<div id="wrapper">
<img id="staticElements" src="img\x.gif" alt="" />
<div class="bodyWrapper">
<img style="filter:chroma();" src="img\x.gif" id="msfilter" alt="" />
<div id="header">
<div id="mtop">
<a id="logo" href="#" title="Travian"></a>
<div class="clear"></div>
</div>
</div>
<div id="mid">
<div id="contentOuterContainer">
<div class="contentTitle"> </div>
<div class="contentContainer">
<div id="content" class="statistics">
<h1 class="titleInHeader"><center>ثبت اطلاعات آدمین</center></h1>
<form action="<?php echo basename(__FILE__); ?>" method="post" name="signupform" id="signupform">
<h3>
<input name="form_name" type="hidden" id="form_name" value="signupform">
</h3>
<table border="0" cellpadding="1" cellspacing="0" style="width:300px;border: solid 0px #fff;">
<tbody>
<tr>
<td><label for="textfield">نام کاربری:</label></td>
<td> <input name="textfield" type="text" disabled id="textfield" value="admin" style="background:#484848;color:#fff"></td>
</tr>
<tr>
<td><label for="fullname">نام شما:</label></td>
<td><input name="fullname" type="text" required id="fullname">
<input name="username" type="hidden" id="username" value="admin"> </td>
</tr>
<tr>
<td><label for="password">رمز عبور:</label></td>
<td><input name="password" type="password" required id="password"></td>
</tr>
<tr>
<td> <label for="confirmpassword">تایید رمز:</label></td>
<td> <input name="confirmpassword" type="password" required id="confirmpassword"></td>
</tr>
<tr>
<td><label for="email">ایمیل:</label></td>
<td> <input name="email" type="email" required id="email"></td>
</tr> </tbody>
</table>
<p><?php echo $error_message; ?> </p>
<br><p>
<input type="submit" name="signup" class="button2_smt" id="signup" value="مرحله بعد">
</p>
</form>
<div class="clear"> </div></div>
<div class="clear"></div></div>
<div class="contentFooter"> </div></div>
<div id="side_info">
</div>
<div class="clear"></div>
</div>
</div>
<div id="ce"></div>
</div>
</body>
</html>