Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Registracijoje herojaus pasirinkimas

Parašė liferulex· 2007 Lie. 31 11:07:50
#1

Sveiki, gal kas galite padeti kaip padaryti tokia registracija kaip wap-dzer.info ? plz mano saite zip.xz.lt/mu neisiejna man taip padaryti kad butu galima registruoti heroju ir ji rodytu wartotojo aprasyme jai reikia va kodas index [code][/<?php
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");

include "mysql.php";
include "nustatymai.php";

if( !empty($_GET['ref']) )
{
$fp = fopen("ref/".$_GET['ref'].".txt", "r");
$i = fread($fp, 1024);
$i++;

$fp = fopen("ref/".$_GET['ref'].".txt", "w");
fwrite($fp, $i);
fclose($fp);
}

if($id == "")
{
echo "
<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">
<img src=\"images/muonline.gif\" alt=\"\"/><br/>
==========<br/>
<small>Naujienos: idetas GM SHOP, dvi naujos zonos ir avatarai.</small><br/>
==========<br/>
<a href=\"index.php?id=prisijungimas\"><img src=\"images/log3.gif\" alt=\"\"/></a><br/>
<a href=\"index.php?id=registracija\"><img src=\"images/reg3.gif\" alt=\"\"/></a><br/>
==========<br/>";

$online = mysql_num_rows(mysql_query("SELECT nick FROM online"));
if( !$online ){
mysql_query("REPAIR TABLE `online`");
}

echo "
<small>Online: <b>$online</b></small><br/>==========<br/><img src=\"http://gun3d.info/masters/count.php?u=furianmu\" alt=\"cnt\"/><br/>==========<br/><small>© Furiant82; 2007/07/01. Visos teises saugomos.</small>
</p>";
}
if($id == "prisijungimas")
{
echo "
<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">
<small>$title:<br/>Prisijungimas</small><br/>
==========<br/>
</p><p>
<small>Žaidėjes:</small><br/>
<input name=\"nn\" maxlength=\"15\" title=\"Vartotojas\" type=\"text\"/><br/>
<small>Slaptažodis:</small><br/>
<input name=\"pas\" title=\"Slaptazodis\" type=\"password\"/><br/>
</p><p align=\"center\">
==========<br/>
<small><b><anchor>Bandyti jūngtis<go href=\"index.php?id=jungiama&nn=$(nn)&pas=$(pas)\"></go></anchor></b></small><br/>
=========<br/>
<small><anchor>Grįžti į pradžią<go href=\"index.php?id=\"></go></anchor></small></p>";
}
if($id == "registracija")
{
echo "
<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">
==========<br/>
<small>$title:<br/>Registracija</small><br/>
==========<br/>
</p><p>
<small>Žaidėjas:</small><br/>
<input name=\"username\" maxlength=\"10\" type=\"text\"/><br/>
<small>Slaptažodis:</small><br/>
<input name=\"password1\" type=\"password\"/><br/>
<small>Pakartok Slaptažodį:</small><br/>
<input name=\"password2\" type=\"password\"/><br/>
<small>Pairink Kovotoja</small><br/>
</p><p>
<select name=\"Zaidejas\">
<option value=\"cena\">Cena</option>
<option value=\"edge\">Edge</option>
<option value=\"triple-h\">Triple-H</option>
<option value=\"umaga\">Umaga</option>
<option value=\"undertaker\">Undertaker</option>
<option value=\"ahon\">Shon mickls</option>
<option value=\"baptista\">Baptista</option>
</select><br/>
</p><p align=\"center\">==========<br/>
<small><b><anchor>Registruoti žaidėję<go method=\"post\" href=\"index.php?id=registruoju\">
<postfield name=\"username\" value=\"$(username)\"/>
<postfield name=\"password1\" value=\"$(password1)\"/>
<postfield name=\"password2\" value=\"$(password2)\"/>
</go>
</anchor></b></small><br/>==========<br/><small>
<anchor>Grįžti į pradžią<go href=\"index.php?id=\"></go></anchor>
</small></p>";
}
if($id == "registruoju")
{
if(isset($_POST['username'])){$username = addslashes($_POST['username']);}else{$username = "";}
if(isset($_POST['password1'])){$password1 = addslashes($_POST['password1']);}else{$password1 = "";}
if(isset($_POST['password2'])){$password2 = addslashes($_POST['password2']);}else{$password2 = "";}

if($username == ""||$password1 == ""||$password2 == "")
{
$klaida[] = "Užpildykite visus laukelius.";
}
if(strlen($username) < 4)
{
$klaida[] = "Žaidėjo vardas per trumpas.";
}
if(preg_match("/[^A-z0-9]/", $username))
{
$klaida[] = "Naudojami neleistini simboliai.";
}
if(preg_match("/[^A-z0-9]/", $password1))
{
$klaida[] = "Naudojami neleistini simboliai.";
}
if(preg_match("/[^A-z0-9]/", $password2))
{
$klaida[] = "Naudojami neleistini simboliai.";
}
if($password1 != $password2)
{
$klaida[] = "Slaptažodžiai nesutapo.";
}
if($klaida != "")
{
echo "
<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">
==========<br/>
<small>$title: Registracija</small><br/>
==========<br/>
</p><small>Registracijos klaidos:</small><p>";
$x = 0;
for($i = 0; $i < count($klaida); $i++)
{
$x++;
echo "<u>$x.</u><small>$klaida[$i]</small><br/>";
}
echo "
</p><p align=\"center\">
==========<br/>
<small><anchor>Grįžti atgal<go href=\"index.php?id=registracija\"></go></anchor></small>
</p></card></wml>";
exit;
}
$username = str_replace("\'", "", $username);
$username = str_replace("_", "", $username);
$username = str_replace("-", "", $username);
$username = str_replace(">", "", $username);
$username = str_replace("<", "", $username);
$username = str_replace(")", "", $username);
$username = str_replace("(", "", $username);
$username = str_replace("&", "", $username);
$username = str_replace("@", "", $username);
$username = str_replace(".", "", $username);
$username = str_replace("'", "", $username);
$username = str_replace("*", "", $username);
$username = str_replace("!", "", $username);
$username = str_replace("%", "", $username);

if(mysql_query("INSERT INTO users (nick,pass,pinigai,stiprumas,lygis,givybes,laikas) VALUES ('$username','".md5($password1)."','0','5','1','100','".time()."')"))
{
mysql_query("INSERT INTO bankas (kieno,kiekis) VALUES ('$username','0')") or die(mysql_error());
echo "
<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">
==========<br/>
<small>$title: Registracija</small><br/>
==========<br/>
<small>Jūsų duomenys sėkmingai įtraukti į duomenų bazę.<br/>---<br/>
<anchor>[Prisijūngti]<go href=\"index.php?id=prisijungimas\"></go></anchor></small>
</p>";
}
else
{
echo "
<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">
==========<br/>
<small>$title: Registracija</small><br/>
==========<br/>
<small>Toks žaidėjes jau registruotas.<br/>==========<br/>
<anchor>Grįžti atgal<go href=\"index.php?id=registracija\"></go></anchor></small>
</p>";
}

}
if($id == "jungiama")
{

if(!mysql_fetch_row(mysql_query("SELECT `nick` FROM users WHERE `nick` LIKE '".$_GET['nn']."' AND pass='".md5($_GET['pas'])."'")))
{
echo "
<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml><card id=\"index\" title=\"$title\">
<p align=\"center\"><small><b>Klaida:</b>Jūs esate neregistruotas arba įvedėte neteisingus duomenis.</small></p></card></wml>";
exit;
}
else
{
session_name('wapID');
session_start();

$_SESSION['nick'] = $_GET['nn'];
$_SESSION['pass'] = $_GET['pas'];
echo "
<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml><card id=\"index\" title=\"$title\">
<p align=\"center\"><small><b>
Prisijūngei sėkmingai!</b></small><br/>=====<br/><small>
Susiek šiame puslapyje žymelę, kad nereikėtų kiekvieną kartą įvedinėti duomenų.</small><br/>=====<br/>
<small><b><anchor>Eiti toliau<go href=\"prisijungus.php?wapID=".session_id()."\"></go></anchor></b></small>
</p>";
}
}
echo "</card></wml>";
?>] buciau labai dekingas jai padetumet :D:D;)