Просмотр файла reg.php

Размер файла: 4.04Kb
<?php

Error_Reporting(E_ALL & ~E_NOTICE);

Error_Reporting (ERROR | WARNING);

extract($HTTP_GET_VARS);

extract($HTTP_POST_VARS);

extract($HTTP_COOKIE_VARS);

extract($HTTP_SERVER_VARS);

extract($HTTP_SESSION_VARS);

session_name("SESID"); 

session_start();

include "start.php";

include "cfg.php";
mysql_connect ($DB_HOST, $DB_USER, $DB_PASS);
mysql_select_db($DB_NAME);header("Content-type:text/html;charset=utf-8");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
include "head.php";

print '<div class="header">Итоги регистрации</div>';

$q_u_l=@mysql_query("select title from users where title='".$title."';");
$u_l=@mysql_fetch_array($q_u_l);


if(empty($title)) $error = $error."<b><font color=red>Нет названия!</font></b><br/>";
if(empty($pass)) $error = $error."<font color=red><b>Вы не ввели пароль!</b></font><br/>";
if(empty($email)) $error = $error."<font color=red><b>Вы не ввели E-mail!</b></font><br/>";
if(empty($link)) $error = $error."<font color=red><b>Вы не ввели адрес сайта!</b></font><br/>";
if(empty($about)) $error = $error."<font color=red><b>Нет описания!</b></font><br/>";
if(empty($error))
{
if (@MySQL_Num_rows($q_u_l)==0)
{
$title = htmlspecialchars(stripslashes(trim($title)));
$pass = htmlspecialchars(stripslashes(trim($pass)));
$email = htmlspecialchars(stripslashes(trim($email)));
$link = htmlspecialchars(stripslashes(trim($link)));
$about = htmlspecialchars(stripslashes(trim($about)));
if($tr_title==1 or $tr_about==1){include_once "trans.php";}

if($tr_title==1){$title=eng_to_rus($title);}

if($tr_about==1){$about=eng_to_rus($about);}

if(mysql_query("insert into users values(0,'$title','$pass','$email','$link','$about',NOW(),0,0,0,0,0,0,0,0,0,'','','','',0,0,0,0);")) {

echo"Вы успешно зарегистрированы. <b>Разместите код счетчика у себя на главной странице:</b><br/>";
$query = mysql_query("select id,title from users where title='".$title."';");
$data = mysql_fetch_array($query);
print htmlspecialchars("<a href=\"$sima_url/index.php?cid=".$data['id']."\"><img src=\"$sima_url/c.php?id=".$data['id']."\" alt=\"$sima_top\"/></a><br/>");
$kod=htmlspecialchars("<a href=\"$sima_url/index.php?cid=".$data['id']."\"><img src=\"$sima_url/c.php?id=".$data['id']."\" alt=\"$sima_top\"/></a><br/>");

?>

<br/>Скопировать код:<br/><input type="text" name="kod" value="<? echo"$kod"; ?>" emptyok="true"/><br/>

<?

echo"<br/><font color=\"red\"><b>Внимание!</b></font><br/> Ваш ID: <b>".$data['id']."</b><br/>Ваш пароль: <b>".$pass."</b><br/>ID и пароль потребуются вам для изменения профиля!<br/>".$srd."<br/><a href=\"index.php\">В рейтинг</a><br/>";

$headers="From: $mailadmin\n";

$headers.="X-Sender: < $mailadmin >\n";
$headers.="Content-Type: text/plain; charset=\"utf-8\"\n";

$message = "Вы успешно зарегистрированы в рейтинге на сайте $index_url\nВаш ID: ".$data['id']."\nВаш пароль: $pass\nID и Пароль потребуются вам для изменения профиля.\nРазместите на страницах своего сайта следующий html код:\n<a href=\"$sima_url/index.php?cid=".$data['id']."\"><img src=\"$sima_url/c.php?id=".$data['id']."\" alt=\"$sima_top\"/></a><br/>\nСпасибо за регистрацию в нашем рейтинге!\n***\nС уважением администрация сайта $index_url";
$tema = "Registration";

mail($email,$tema,$message,$headers); }
} else {
echo"<font color=\"red\">В нашей базе уже есть сайт с таким названием!</font><br/>
$srd<br/>
$ss<a href=\"registration.php\">Повторить ввод</a><br/>";
}
}
else
{
print $error;
echo"$srd<br/>
$ss<a href=\"registration.php\">Повторить ввод</a><br/>";

}
mysql_close();

include "foot.php";

?>