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

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

header("Cache-Control: no-cache");

header("Content-type:text/vnd.wap.wml");   

$ref=rand(10000,1000000);         

require("conf.inc.php");

$linkk = @mysql_pconnect ($MySQL_Hostname, $MySQL_Username, $MySQL_Password)

                or die ("<wml>

<card id=\"error\" title=\"error\">

<do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\">Can not connect to MySQL<br/>".mysql_error()."</p>

</card>

</wml>");

     

     @mysql_select_db($MySQLDatabasename) or die ("<wml>

<card id=\"error\" title=\"error\">

<do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\">error select the database...<br/>".mysql_error()."</p>

</card>

</wml>"); 



echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";

echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";

echo "<wml>\n";

echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";

echo "<card id=\"index\" title=\"&#x420;&#x435;&#x433;&#x438;&#x441;&#x442;&#x440;&#x430;&#x446;&#x438;&#x44F;\">\n";

echo "<p align=\"left\" mode=\"wrap\">\n";



$q_u_l=@mysql_query("select link,id from users where link='".$link."'");



if(empty($title)) $error = $error."<b>&#x412;&#x44B; &#x43D;&#x435; &#x432;&#x432;&#x435;&#x43B;&#x438; &#x437;&#x430;&#x433;&#x43E;&#x43B;&#x43E;&#x432;&#x43E;&#x43A; &#x432; &#x433;&#x43E;&#x441;&#x442;&#x435;&#x432;&#x43E;&#x439;!!</b><br/>";

if(empty($msgs)) $error = $error."<b>&#x412;&#x44B; &#x43D;&#x435; &#x432;&#x432;&#x435;&#x43B;&#x438; &#x43A;&#x43E;&#x43B;-&#x432;&#x43E; &#x441;&#x43E;&#x43E;&#x431;&#x449;&#x435;&#x43D;&#x438;&#x439; &#x43D;&#x430; &#x441;&#x442;&#x440;&#x430;&#x43D;&#x438;&#x446;&#x443;!</b><br/>";

if(empty($pass)) $error = $error."<b>&#x412;&#x44B; &#x43D;&#x435; &#x432;&#x432;&#x435;&#x43B;&#x438; &#x43F;&#x430;&#x440;&#x43E;&#x43B;&#x44C;!!</b><br/>";

if(empty($link)) $error = $error."<b>&#x412;&#x44B; &#x43D;&#x435; &#x432;&#x432;&#x435;&#x43B;&#x438; &#x430;&#x434;&#x440;&#x435;&#x441; &#x432;&#x430;&#x448;&#x435;&#x433;&#x43E; &#x441;&#x430;&#x439;&#x442;&#x430;!</b><br/>";

if(empty($razdel)) $error = $error."<b>&#x412;&#x44B; &#x43D;&#x435; &#x432;&#x432;&#x435;&#x43B;&#x438; &#x440;&#x430;&#x437;&#x434;&#x435;&#x43B;&#x438;&#x442;&#x435;&#x43B;&#x44C; &#x441;&#x43E;&#x43E;&#x431;&#x449;&#x435;&#x43D;&#x438;&#x439;!!</b><br/>";

if(empty($error))

{

                if (@MySQL_affected_rows()==0)

                {



        $title = htmlspecialchars(stripslashes(trim($title)));

        $msgs = htmlspecialchars(stripslashes(trim($msgs)));

        $pass = htmlspecialchars(stripslashes(trim($pass)));

        $email = htmlspecialchars(stripslashes(trim($email)));

        $link = htmlspecialchars(stripslashes(trim($link)));

        $razdel = htmlspecialchars(stripslashes(trim($razdel)));

        $sitename = htmlspecialchars(stripslashes(trim($sitename)));



$msgearch = array ("'\t'i",                                               

                 "'([\n])[\s]+'",                                       

                 "'\s{2,}'",                                                                                

                 "'&(nbsp|#160);'i",                            

                 "'&#(\d+);'i");                                        

//               "'&#(\d+);'e");                                

$replace = array ("",

                  "\n",

                  " ",

                  " ",

                  "-");

//                "chr(\\1)");

$title = preg_replace ($msgearch, $replace, $title);

$title=str_replace('$','$$',$title);           

$title=preg_replace("/\[!\[/","<",$title);                

$title=preg_replace("/\]!\]/",">",$title);  



$msgs = preg_replace ($msgearch, $replace, $msgs);

$msgs=str_replace('$','$$',$msgs);           

$msgs=preg_replace("/\[!\[/","<",$msgs);                

$msgs=preg_replace("/\]!\]/",">",$msgs);

  

$link = preg_replace ($msgearch, $replace, $link);

$link=str_replace('$','$$',$link);           

$link=preg_replace("/\[!\[/","<",$link);                

$link=preg_replace("/\]!\]/",">",$link);



$razdel = preg_replace ($msgearch, $replace, $razdel);

$razdel=str_replace('$','$$',$razdel);           

$razdel=preg_replace("/\[!\[/","<",$razdel);                

$razdel=preg_replace("/\]!\]/",">",$razdel);    



$sitename = preg_replace ($msgearch, $replace, $sitename);

$sitename=str_replace('$','$$',$sitename);           

$sitename=preg_replace("/\[!\[/","<",$sitename);                

$sitename=preg_replace("/\]!\]/",">",$sitename);    



$now = date("j-m-Y");





        if(mysql_query("Insert into users set title='".$title."', msgs='".$msgs."', pass='".$pass."', email='".$email."', link='".$link."', sitename='".$sitename."', date='".$now."', razdel='".$razdel."'")) {

                echo "&#x413;&#x43E;&#x441;&#x442;&#x435;&#x432;&#x430;&#x44F; &#x443;&#x441;&#x43F;&#x435;&#x448;&#x43D;&#x43E; &#x437;&#x430;&#x440;&#x435;&#x433;&#x438;&#x441;&#x442;&#x440;&#x438;&#x440;&#x43E;&#x432;&#x430;&#x43D;&#x430;!";

                print "&#x410;&#x434;&#x440;&#x435;&#x441; &#x432;&#x430;&#x448;&#x435;&#x439; &#x433;&#x43E;&#x441;&#x442;&#x435;&#x432;&#x43E;&#x439;:<br/>";

                $query = mysql_query("select * from users where link='".$link."'");

                $data = mysql_fetch_array($query);

                echo "http://wap.waup.ru/sgb/index.php?id=".$data['id']."";

                echo "<br/><b>&#x417;&#x430;&#x43F;&#x43E;&#x43C;&#x43D;&#x438;&#x442;&#x435;, &#x430; &#x43B;&#x443;&#x447;&#x448;&#x435; &#x437;&#x430;&#x43F;&#x438;&#x448;&#x438;&#x442;&#x435;! &#x412;&#x430;&#x448; id: ".$data['id']." , &#x43F;&#x430;&#x440;&#x43E;&#x43B;&#x44C;: ".$data['pass']." !</b>";

                echo "<br/><a href=\"$link\">&#8594;&#x41D;&#x430; &#x412;&#x430;&#x448; &#x441;&#x430;&#x439;&#x442;</a>";

                echo "<br/><a href=\"index.php?id=".$data['id']."\">&#8594;&#x412; &#x433;&#x43E;&#x441;&#x442;&#x435;&#x432;&#x443;&#x44E;</a><br/><a href=\"in.php\">&#8594;&#x0421;&#x0435;&#x0440;&#x0432;&#x0438;&#x0441; &#x0433;&#x043E;&#x0441;&#x0442;&#x0435;&#x0432;&#x044B;&#x0445;</a> ";

        }

        } else {

        $sl= mysql_fetch_array($q_u_l);

        echo "&#x414;&#x43B;&#x44F; &#x441;&#x430;&#x439;&#x442;&#x430; $link &#x433;&#x43E;&#x441;&#x442;&#x435;&#x432;&#x430;&#x44F; &#x443;&#x436;&#x435; &#x437;&#x430;&#x440;&#x435;&#x433;&#x438;&#x441;&#x442;&#x440;&#x438;&#x440;&#x43E;&#x432;&#x430;&#x43D;&#x430;!<u>&#x415;&#x451; id=".$sl['id']." </u>";

        echo "<br/><a href=\"reg.wml\">&#8592;&#x41D;&#x430;&#x437;&#x430;&#x434;</a>";

        echo "<br/><a href=\"http://****\">&#169; ****</a>";

        }

}

else

{

print $error;

}

echo "</p>\n";

echo "</card>\n";

echo "</wml>\n";

@mysql_close($linkk);

?>