Help! Connect.php (wap)

Started on the old forum in May 2008 · view the original in the archive · old links redirect here

11 replies · 1,623 views · started 18 years ago · 1 min read

4 participants
Guest #1
<?php if (!get_magic_quotes_gpc()) { $_GET = array_map('trim', $_GET); $_POST = array_map('trim', $_POST); $_COOKIE = array_map('trim', $_COOKIE); $_GET = array_map('addslashes', $_GET); $_POST = array_map('addslashes', $_POST); $_COOKIE = array_map('addslashes', $_COOKIE); } include_once("config.php"); $db = @mysql_connect($dbhost, $dbuser, $dbpass) or die("<img src=\"img/banner.gif\" alt=\"$title\"/> $line Problemos jungiantis prie serverio. Pabandykite veliau. Serveris dar tvarkomas - DarkWizardLT $line <a href=\"http://wapdark.roflmfao.cn\">Wap-Dark</a> </card></wml>"); mysql_select_db($dbname, $db); ?>

I dont understand where I need write my db info? I getting "Problemos jungiantis prie serverio. Pabandykite veliau. Serveris dar tvarkomas - DarkWizardLT" message when im going to my wap site (its mine under-constructing message) here is wap game and cant load wap writing that message :/ (my wap wapdark.roflmfao.cn) or I need write database in index.php ? if yes where? Srry for mistakes

[im new in scripting]

Guest #3

Ok lets try EDIT: I cant get it :/ Who can configure my site? I can give hostname, passwrd.. Who can PM me.

Guest #5

I writed my acc details to PM.. If u configure and it will works I will be thankful for u External image (may be gone) EDIT: I think this script is bugged because other scripts is good works to me now I installed PHP-Fusion on web xD Anyway thanks to lazerpoint and andre3 External image (may be gone)

Guest #6

Who can help? Game now working I find out where was problem. But when registers writing Congratulations u registered (on my language) and when I try to log in writing "That character doesnt exist" (wapdark.roflmfao.cn). Reg script:

<?php header("Content-type: text/vnd.wap.wml"); header("Cache-Control: no-store, no-cache, must-revalidate"); print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";

echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; include_once("core.php"); echo"<wml><card id="heroes" title="Registracija"> "; include_once("connect.php"); $i = addslashes(htmlspecialchars($_GET['i'])); if (!$i) { $i = ""; } $ref = addslashes(htmlspecialchars($_GET['ref'])); if (!$ref) { $ref = ""; }

if ($i > 0) { $name = addslashes(htmlspecialchars($_POST['name'])); if (!$name) { $name = ""; } if ($name == "") { echo"Neįvestas herojaus vardas. $line <a href="register.php?ref=$ref">$back</a> </card></wml>"; mysql_close($db); exit; } $check = mysql_fetch_array(mysql_query("SELECT id FROM users WHERE username='$name' LIMIT 1")); if ($check[0] > 0) { echo"Šis vardas jau užregistruotas. $line <a href="register.php?ref=$ref">$back</a> </card></wml>"; mysql_close($db); exit; } if (is_numeric(substr($name,0,1))) { echo"Herojaus vardas negali prasidėti skaičiu. $line <a href="register.php?ref=$ref">$back</a> </card></wml>"; mysql_close($db); exit; } if (strlen($name) < 3) { echo"Herojaus vardas turi būti bent iš trijų simbolių. $line <a href="register.php?ref=$ref">$back</a> </card></wml>"; mysql_close($db); exit; } if (strlen($name) > 20) { echo"Herojaus vardas negali būti ilgesnis nei dvidešimt simbolių. $line <a href="register.php?ref=$ref">$back</a> </card></wml>"; mysql_close($db); exit; } for ($k = 0; $k < strlen($name); $k++) { $symbol = ord($name[$k]); if ((($symbol >= 48) and ($symbol <= 57)) or (($symbol >= 65) and ($symbol <= 80)) or (($symbol >= 82) and ($symbol <= 90)) or (($symbol >= 97) and ($symbol <= 112)) or (($symbol >= 114) and ($symbol <= 122))) { } else { echo"Naudojate blogus simbolius savo herojaus varde. $line <a href="register.php?ref=$ref">$back</a> </card></wml>"; mysql_close($db); exit; } } }

if ($i > 2) { $class = addslashes(htmlspecialchars($_POST['class'])); if (!$class) { $class = ""; } if (!file_exists("heroes/$class")) { echo"Neegzistuojanti herojaus klasė. $line <a href="register.php?ref=$ref">$back</a> </card></wml>"; mysql_close($db); exit; } }

if ($i > 3) { $identify = addslashes(htmlspecialchars($_POST['identify'])); if (!$identify) { $identify = ""; } if (!file_exists("heroes/$class/$identify.php")) { echo"Neegzistuojantis herojus. $line <a href="register.php?ref=$ref">$back</a> </card></wml>"; mysql_close($db); exit; } }

if ($i > 5) { $pass = addslashes(htmlspecialchars($_POST['pass'])); $vpass = addslashes(htmlspecialchars($_POST['vpass'])); if ($pass == "") { echo"Neįvestas slaptažodis. $line <anchor>$back<go href="register.php?m=$m&i=5&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/><postfield name="identify" value="$(identify)"/></go></anchor> </card></wml>"; mysql_close($db); exit; } if ($vpass == "") { echo"Nepakartotas slaptažodis. $line <anchor>$back<go href="register.php?m=$m&i=5&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/><postfield name="identify" value="$(identify)"/></go></anchor> </card></wml>"; mysql_close($db); exit; } if (strlen($pass) < 3) { echo"Slaptažodis turi būti bent iš trijų simbolių. $line <anchor>$back<go href="register.php?m=$m&i=5&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/><postfield name="identify" value="$(identify)"/></go></anchor> </card></wml>"; mysql_close($db); exit; } if (strlen($pass) > 40) { echo"Slaptažodis negali būti ilgesnis nei keturiasdešimt simbolių. $line <anchor>$back<go href="register.php?m=$m&i=5&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/><postfield name="identify" value="$(identify)"/></go></anchor> </card></wml>"; mysql_close($db); exit; } if ($pass !== $vpass) { echo"Slaptažodžiai nesutampa. $line <anchor>$back<go href="register.php?m=$m&i=5&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/><postfield name="identify" value="$(identify)"/></go></anchor> </card></wml>"; mysql_close($db); exit; } if ($pass == $name) { echo"Nenaudokite vietoj slaptažodžio savo herojaus vardo. $line <anchor>$back<go href="register.php?m=$m&i=5&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/><postfield name="identify" value="$(identify)"/></go></anchor> </card></wml>"; mysql_close($db); exit; } }

if ($i == "") { echo"Labai atidžiai išsirinkite herojų - vėliau jo negalėsite pakeisti ir nuo pasirinkimo labai priklausys žaidimo eiga. $line Herojaus vardas:* <input type="text" name="name" maxlength="20"/> <anchor>$next<go href="register.php?m=$m&i=2&ref=$ref" method="post"><postfield name="name" value="$(name)"/></go></anchor> $line Pastaba: * naudokite tik raides ir skaičius. $line Žingsnis: 1 iš 5 $line <a href="index.php?ref=$ref">$home</a>"; }

if ($i == "2") { echo"Pasirinkite herojaus klasę: <select name="class">"; include_once("names/classes.php"); if ($handle = opendir("heroes/")) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && $file != "index.php") { $class = $class_name[$file]; echo"<option value="$file">$class</option>"; } } closedir($handle); } echo"</select> <anchor>$next<go href="register.php?m=$m&i=3&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/></go></anchor> <a href="register.php?ref=$ref">$back</a> $line Žingsnis: 2 iš 5 $line <a href="index.php?ref=$ref">$home</a>"; }

if ($i == "3") { include_once("names/heroes.php"); echo"Pasirinkite herojų: <select name="identify">"; if ($handle = opendir("heroes/$class")) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && $file != "index.php") { $file = explode(".", $file); $heroe = $heroe_name[$file[0]]; echo"<option value="$file[0]">$heroe</option>"; } } closedir($handle); } echo"</select> <anchor>$next<go href="register.php?m=$m&i=4&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/><postfield name="identify" value="$(identify)"/></go></anchor> <anchor>$back<go href="register.php?m=$m&i=2&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/></go></anchor> $line Žingsnis: 3 iš 5 $line <a href="index.php?ref=$ref">$home</a>"; }

if ($i == "4") { include_once("heroes/$class/$identify.php"); include_once("names/heroes.php"); include_once("names/skills.php"); $basic_primary_skills = basic_primary_skills(); $basic_skills = basic_skills(); $heroe_info = heroe_info(); $heroe = $heroe_name[$identify]; echo"$heroe <img src="img/heroes/$identify.gif" alt="$heroe"/> Ataka: $basic_primary_skills[attack] Gynyba: $basic_primary_skills[defense] Galia: $basic_primary_skills[power] Išmintis: $basic_primary_skills[knowledge] $line

Biografija:$heroe_info[biography] Specialybė:$heroe_info[speciality] Sugebėjimai:"; for ($u = 0; $u < count($basic_skills); $u++) { if ($u > 0) { echo", "; } $skill = explode("|", $basic_skills[$u]); echo"".$skill_name[$skill[0]]." ($skill[1])"; }echo". Armija:$heroe_info[army] Papildoma:$heroe_info[extra]

$line <anchor>$next<go href="register.php?m=$m&i=5&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/><postfield name="identify" value="$(identify)"/></go></anchor> <anchor>$back<go href="register.php?m=$m&i=3&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/></go></anchor> $line Žingsnis: 4 iš 5 $line <a href="index.php?ref=$ref">$home</a>"; }

if ($i == "5") { echo"Slaptažodis:* <input type="password" name="pass" maxlength="40"/> Pakartokite Slaptažodį:* <input type="password" name="vpass" maxlength="40"/> $line Pastaba: * patariame slaptažodyje naudoti didžiąsias bei mažiąsias raides ir skaičius. Naudoti ne trumpesnį nei iš aštuonių simbolių. Slaptažodžiai yra koduojami, tad nepamirškite jo. $line <anchor>$next<go href="register.php?m=$m&i=6&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/><postfield name="identify" value="$(identify)"/><postfield name="pass" value="$(pass)"/><postfield name="vpass" value="$(vpass)"/></go></anchor> <anchor>$back<go href="register.php?m=$m&i=4&ref=$ref" method="post"><postfield name="name" value="$(name)"/><postfield name="class" value="$(class)"/><postfield name="identify" value="$(identify)"/></go></anchor> $line Žingsnis: 5 iš 5 $line <a href="index.php?ref=$ref">$home</a>"; }

if ($i == "6") { mysql_query("UPDATE sms SET text='$name', type='registered' WHERE id='$validate[0]' LIMIT 1"); $array = array("A","a","B","b","C","c","D","d","E","e","F","f","G","g","H","h","I","i","J","j","K","k","L","l","M","m","N","n","O","o","P","p","R","r","S","s","T","t","U","u","V","v","W","w","X","x","Y","y","Z","z","0","1","2","3","4","5","6","7","8","9"); while ($session == "") { for ($i = 1; $i <= 20; $i++) { $n = mt_rand(0,59); $id = "$id$array[$n]"; } $check = mysql_fetch_array(mysql_query("SELECT id FROM users WHERE session='$id' LIMIT 1")); if ($check[0] > 0) $id = ""; else break; } $pass = md5(md5($pass)); @$day = mysql_fetch_array(mysql_query("SELECT day FROM time LIMIT 1")); if ($day[0] == "") { $day[0] = 1; $day[1] = time() + $day_length; mysql_query("INSERT INTO time(day, time) VALUES ('$day[0]','$day[1]')"); } include_once("heroes/$class/$identify.php"); $basic_primary_skills = basic_primary_skills(); $time = time(); $spell_points = $basic_primary_skills[knowledge] * 10; $basic_skills = basic_skills(); $skills = "$basic_skills[0]=$basic_skills[1]=$basic_skills[2]=$basic_skills[3]=$basic_skills[4]=$basic_skills[5]=$basic_skills[6]"; $artifacts = "======="; mysql_query("INSERT INTO users(username, password, session, class, identify, attack, defense, power, knowledge, spell_points, day, reg, login, skills, artifacts, online) VALUES ('$name','$pass','$id','$class','$identify','$basic_primary_skills[attack]','$basic_primary_skills[defense]','$basic_primary_skills[power]','$basic_primary_skills[knowledge]','$spell_points','$day[0]','$time','$time','$skills','$artifacts','$time')"); $name = strtolower($name); $basic_army = basic_army(); for ($i = 0; $i < count($basic_army); $i++) { $unit = explode("|", $basic_army[$i]); include_once("units/$unit[0].php"); $q = explode("-", $unit[1]); $qq = mt_rand($q[0], $q[1]); $unit_info[attack] = $unit_info[attack] + $basic_primary_skills[attack]; $unit_info[defense] = $unit_info[defense] + $basic_primary_skills[defense]; @$unit_info = @buy_unit($unit[0], $unit_info); mysql_query("INSERT INTO army(username, unit, quantity, attack, defense, min_damage, max_damage, health) VALUES ('$name','$unit[0]','$qq','$unit_info[attack]','$unit_info[defense]','$unit_info[min]','$unit_info[max]','$unit_info[health]')"); }

if ($ref !== "") {
	mysql_query("UPDATE users SET gold=gold+1000 WHERE username='$ref' LIMIT 1");
	if (mysql_affected_rows() > 0) {
		$date = date("m-d H:i");
		$text = "Sveiki! Per jūsų rekomendavimo nuorodą užsiregistravo **$name** ir jums už tai gaunate 1000 aukso! Ir toliau kvieskite kitus prisijungti prie herojų būrio! ![](http://www.2wap.org/forums/style_emoticons/<#EMO_DIR#>/wink.gif)

Su pagarba, wapdream.com administracija."; mysql_query("INSERT INTO pm(nick, name, text, date, active, action) VALUES ('$ref','Gavote 1000 aukso!','$text','[$date]','0','note')"); $file = @fopen("ref.txt", "r"); flock($file, 1); $count = fgets($file, 255); fclose($file); $file = @fopen("ref.txt", "w"); if ($count == "") { $count = 0; } $count++; fputs($file, $count); flock($file, 2); fclose($file); } } echo"Herojus sėkmingai užregistruotas! $line <a href="index.php?m=$m&id=$id">>>></a>";

$file = @fopen("users.txt", "r");
flock($file, 1);
$count = fgets($file, 255);
fclose($file);
$file = @fopen("users.txt", "w");
if ($count == "") { $count = 0; }
$count++;
fputs($file, $count);
flock($file, 2);
fclose($file);

} echo" </card></wml>"; mysql_close($db); ?>

Login script:

<?php header("Content-type: text/vnd.wap.wml"); header("Cache-Control: no-store, no-cache, must-revalidate"); print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";

echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; include_once("core.php"); echo"<wml><card id="heroes" title="Prisijungimas"> "; include_once("connect.php"); $i = addslashes(htmlspecialchars($_GET['i'])); if (!$i) { $i = ""; } $ref = addslashes(htmlspecialchars($_GET['ref'])); if ($i == "") { echo"Prisijungimas $line Vardas: <input type="text" name="name" maxlength="14"/> Slaptažodis: <input type="password" name="pass" maxlength="40"/> <anchor>Prisijungti<go href="login.php?i=2" method="post"><postfield name="name" value="$(name)"/><postfield name="pass" value="$(pass)"/></go></anchor> $line <a href="index.php?ref=$ref">$home</a>"; } if ($i == "2") { $name = addslashes(htmlspecialchars($_POST['name'])); $pass = addslashes(htmlspecialchars($_POST['pass'])); if ($name == "") { echo"Neįvestas herojaus vardas. $line <a href="login.php">$back</a> <a href="index.php">$home</a> </card></wml>"; mysql_close($db); exit; } $check = mysql_fetch_array(mysql_query("SELECT id FROM users WHERE username='$name' LIMIT 1")); if ($check[0] == "") { echo"Toks herojus neegzistuoja. $line <a href="login.php">$back</a> <a href="index.php">$home</a> </card></wml>"; mysql_close($db); exit; } if ($pass == "") { echo"Neįvestas slaptažodis. $line <a href="login.php">$back</a> <a href="index.php">$home</a> </card></wml>"; mysql_close($db); exit; } $pass = md5(md5($pass)); $id = mysql_fetch_array(mysql_query("SELECT session FROM users WHERE username='$name' and password='$pass' LIMIT 1")); if ($id[0] == "") { echo"Neteisingas slaptažodis. $line <a href="login.php">$back</a> <a href="index.php">$home</a> </card></wml>"; mysql_close($db); exit; } mysql_query("UPDATE users SET username='$name' WHERE session='$id[0]' LIMIT 1"); echo"Prisijungėte sėkmingai! $line <a href="index.php?id=$id[0]">>>></a>"; } echo" </card></wml>"; mysql_close($db);

?>

Who know where is problem? pls help (i didnt created new topic because this already is about helping and i did double post because to make active this topic and wait until someone replie..)

Guest #8

1.here arent my site information details. 2.my config.php is good. (and i know how to change password anyway) 3. on config is my information detail (db, password xD) 4.problem with register.php or login.php. 5.anyway I think nobody needs game with bad login.php.

subzero Super moderator Fellow · 3,954 posts #9

what ever you do mate they just downloaded your files when they fixed your site lol dont trust no one in here only one is gumslone

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Guest #10

Lol. Here are and good ppl like andre External image (may be gone) And who needs my wap sites and web site? It sux newbie can create it. xD EDIT: I dont need info anymore close this topic pls. [3 reasons: 1. boored of waiting who can help with this game; 2. I have other working game; 3. Ill better try to create MUOnline, Emperor or WapDrag game External image (may be gone)]

subzero Super moderator Fellow · 3,954 posts #11

thats why ppl post php and mysql e-books mate

gumslone can code really good also why he steal what he can make lol

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Guest #12

Anyway I didnt created this code so why they cant copy? External image (may be gone) (this game ill creating only for TRY to learn better PHP External image (may be gone) after that ill recreate game for fun)

thats why ppl post php and mysql e-books mate

gumslone can code really good also why he steal what he can make lol

So why ppl cant copy php e-books? Acrobat reader could help External image (may be gone)

Off topic boored of this chatting. Or lets PM External image (may be gone) (i dont have many time because in my country 23:30 and i want to do many things)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close