PDA

View Full Version : درخواست قرار دادن تصویر امنیتی در صفحه ثبت نام



vahids2007
پنج شنبه 06 مرداد 1390, 09:52 صبح
سلام بر دوستان
سلام
من یک صفحه ثبت نام دارم که می خواهم یک کد امنیتی در اون صفحه قرار بدم که کادر ها شامل نام-ایمیل-تایید ایمیل-پسورد-است
لطفا کدهای که فرستادم را ویرایش کنید و تصویر امنیتی را در آن قرار دهید هزینه آن را هم پرداخت میکنم
این هم کد php کامل صفحه

<?php
require_once(dirname(__FILE__) . '/libs/b3.php');
require_once(dirname(__FILE__) . '/libs/GRS.function.php');
$headertitle = "Create a New Account";include('header.php');

if ($_SERVER['QUERY_STRING'] == 'terms') {
uheader();
echo("<div align=center class=\"big\">Terms and Conditions</div>\n");
$res = mysql_query("select content from html where type='terms'");
$terms = mysql_result($res, 0, "content");
echo($terms);
ufooter();
} else {
$res = mysql_query("select content from html where type='head1'");
$hf = mysql_result($res, 0, "content");
echo($hf);
if ($form == 'sent') {
$checkpass = 'true';
$error = '<div align=center><font face=$fontface color=red size=2><b>Please, correct the following:<br>';
if (ereg('%', $name) || ereg('<', $name) || ereg('>', $name)) {
$error = $error . 'Your name contains inadmissible characters<br>';
$checkpass = 'false';
}
if ($name == "") {
$error = $error . 'You must enter your name<br>';
$checkpass = 'false';
}
$trimail = trim($email1);
$res = mysql_query("select count(*) from user where email='$trimail1'");
if (mysql_result($res, 0) != 0) {
$error = $error . 'Your e-mail address is already registered<br>';
$checkpass = 'false';
}
if (!ereg('@', $email1) || !ereg('.', $email1)) {
$error = $error . 'Your e-mail address is invalid<br>';
$checkpass = 'false';
}
if ($email1 != $email2) {
$error = $error . 'Your e-mail address doesn\'t match<br>';
$checkpass = 'false';
}
if ($passwd == "") {
$error = $error . 'You must enter your password<br>';
$checkpass = 'false';
} elseif (strlen($passwd) < 6) {
$error = $error . 'Your password must be at least 6 characters long<br>';
$checkpass = 'false';
}
if (ereg('%', $passwd) || ereg(' ', $passwd)) {
$error = $error . 'Your password contains inadmissible characters<br>';
$checkpass = 'false';
}
if ($C->sfrfvi('count(*)', 'user', 'where email="'.addslashes($email1).'"') === 1) {
$error = $error . 'The e-mail address is already registered<br>';
$checkpass = 'false';
}
/*
check the signup ip. it must not be used before. it it has been used, then the user can't sign up.
Hardi. 21.07.2008 10:21
IPB
*/
if ($Cuscus->sfrfvi('COUNT(*)', 'user', 'where activate_IP = "' . $_SERVER['REMOTE_ADDR'] . '"')) {
$error .= 'This IP has already been used<br>';
$checkpass = 'false';
}
//eo IPB
if ($termscheck != 1) {
$error = $error . 'Your must check and agree to our terms<br>';
$checkpass = 'false';
}
if ($checkpass != 'true') {
$error = $error . '</font></b></div>';
echo($error);
}
}
if ($checkpass != 'true') {
echo("<table border=0 cellpadding=5 cellspacing=0 width=100%><form action=$PHP_SELF method=post name=nu><input type=hidden name=form value=sent>\n");
if (isset($ref) && is_numeric($ref)) {
echo("<input type=hidden name=ref value=$ref>");
}
echo("<tr><td class=boxtext width=50% align=right valign=top><font >نام شما:</td><td class=boxtext width=50% align=left valign=top><input value=\"$name\" type=text name=name size=20 maxlength=100></td></tr>\n");
echo("<tr><td class=boxtext align=right valign=top><font >ایمیل شما:</td><td class=boxtext align=left valign=top><input value=\"$email1\" type=text name=email1 size=20 maxlength=100></td></tr>\n");
echo("<tr><td class=boxtext align=right valign=top><font >تایید ایمیل:</td><td class=boxtext align=left valign=top><input value=\"$email2\" type=text name=email2 size=20 maxlength=100></td></tr>\n");
echo("<tr><td class=boxtext align=right valign=top><font >رمز عبور:</td><td class=boxtext align=left valign=top><input value=\"$passwd\" type=password name=passwd size=20 maxlength=20></td></tr>\n");
echo("<tr><td class=boxtext align=center valign=top colspan=2><input type=checkbox");
if ($termscheck == 1) {echo(" checked");}
echo(" name=termscheck value=1><font > I agree with <a href=terms.php target=_blank><b><font>terms and conditions</b></a></td></tr>\n");
/*echo("<tr><td class=boxtext align=center valign=top colspan=2><b><font ><b><font color=red>Important:</font></b> Your site must not have any pop-up windows, must not break out of frames, must not use any forwarding or redirection!</b></td></tr>\n");*/
echo("<tr><td class=boxtext align=center valign=top colspan=2><input type=submit value=\"Register!\"></td></tr>\n");
echo("</form></table>\n");
} else {
srand((double)microtime()*1000000);
$ac = rand(1000, 10000);
$name = trim($name);
$email = trim($email1);
$sitename = trim($sitename);
$name = addslashes($name);
$sitename = addslashes($sitename);
$res = mysql_query("select value from adminprops where field='inibon'");
$inibon = mysql_result($res, 0, "value");
if (!isset($ref) || !is_numeric($ref)) {$ref=0;}
$date = date("Y-m-d H:i:s");
$secid = GRS(10);
$res = mysql_query("insert into user (name, email, passwd, ref, acctype, credits, joindate, minmax, lastaccess, ac, secid) values ('$name', '$email', '$passwd', $ref, 1, 0, '$date', 1, '$date', $ac, '$secid')");
$usrid = mysql_insert_id();
$surpres = mysql_query("update adminprops set value=value-$inibon where field='surplu'");
$res = mysql_query("select value from admin where field='email'");
$admail = mysql_result($res, 0, "value");

if ($ref != 0) {

$getrefemail = mysql_query("select email from user where id=$ref");

if (mysql_num_rows($getrefemail) !=0) {
$refemail = mysql_result($getrefemail, 0, "email");

mail($refemail, "New Referral At $title", "Hello, a new referral has joined your $title downline!\n\nThank you for promoting your $title referral URL!\n\n$title Admin\nhttp://$siteurl/\n$admail", "From: \"$title Admin\" <$admail>");

}
}
mail($email, "Thank you for registration at $title!", "$name, Thank you for registration!\n\nYour $title login is: $email\nYour $title password is: $passwd\n\nTo activate your account you must open the following link:\n$self_url" . "activate.php?ac=$ac&i=$usrid\nClick or copy-paste it to your browser's query string.\n\nYour referral link is:\nhttp://$siteurl?ref=$usrid\nYou will earn 0.1 credit every time your referant shows a site!\n\nBy activating your account, you agree to receive future emails. You can stop receiving by deleting your account.\n\n$title Admin\nhttp://$siteurl/\n$admail", "From: \"$title Admin\" <$admail>");
echo("<p align=center class=\"big\">از ثبت نام شما متشکریم</p>");
echo("<p align=center>لینک فعال سازی به این ایمیل ارسال شد $email.</p>");
echo("<p align=center>لطفا پوشه اسپم خود را هم چک کنید.</p>");
}
ufooter();
}
include('footer.php');
?>