Jump to content

gamesmstr

Members
  • Posts

    140
  • Joined

  • Last visited

Everything posted by gamesmstr

  1. I'm sorry I should have been a bit more specific, The problem that I am having is in the formatting for my query. I do need to remove that function call though. It is a php function and I can call it elsewhere.
  2. Right, but this is inside the "" of a .innerHTML call. It is wrecking havoc on my typical coding.
  3. Not sure if this is the right place for this. It is a mix of JS and PHP but the formatting problem I am having is in the PHP part. I am using an onclick event to call the following function: <script type="text/javascript"> function movenorth() { document.getElementById("outlandsbox").innerHTML = "<?php if ($_SESSION['email']){ $email=$_SESSION['email']; $password=$_SESSION['password']; } $id=$_SESSION['uid']; $uy=$_SESSION['uy']; $_SESSION['reload']='y'; if ($uy > 0){ mysql_query("Update outland_user_data set uy=uy-1 where id='$id'"); } OutlandsMain($email, $password); ?>"; } </script> The fuction doesn't work, but the query launches every time the page is loaded. I know it has to do with my use of quotes. I also noticed that when I tried this: echo 'test $email $password'; it returns this: instead of the values of the variables. help?
  4. I am using a button with an onclick parameter to launch a AJAX JS function and passing some php variables, but I need help with the formatting. The 2 variables are $playerinfo[id] and $questrecord[uy]. <input type="button" value="North" onclick="playermove('north',playerinfo[id],questrecord[uy])">
  5. I am trying to reduce the page loads in one of the applications of my game. To do so, I am making greater use of functions, but I have come across an interesting problem. I need to get input from the user in the form of either pressing a button or clicking a button or a link to indicate an action. I then want to use that input to call a php function. You see where I am going with this I am sure. I know that html and JS are client side and PHP is server side so there is difficulties in the communication between the two. So here is my question: Is there a php function to accept input and call a function? Barring that, is there a way to call a php function from a form or href without having to reload the page?
  6. ok, I found an include in the gameconfig file that was unnecessary, but it did not completely solve my problem. I went to a different page which is shorter. Here is the code. <? session_start(); include("gameconfig.php"); $title = "Game Information- The Bank"; if(!$email || !$password){ error("field"); exit;} if($playerinfo[jailtime] > 0){ error("jail"); exit;} if($playerinfo[password] != $password){ error("password");} else{ include("top.php"); //CAN ONLY VIEW INSIDE CORRECT CITY if($playerinfo[city] == "side"){ echo "You can't visit this place from the Countryside.<p>"; echo "<a href = \"javascript:history.back()\"> Go Back </a>"; include("bottom.php"); exit; } else{ if ($action != "withdraw" && $action != "deposit" && $action != "tdeposit"){ echo "Welcome to the Bank. You can deposit your extra credits in here, to avoid having them stolen by attackers, or withdraw your funds to purchase that new equipment you desire.<br><br>"; ?> <form method=post action=bank.php?action=withdraw> <? echo "<center><table border=1 cellspacing=0 cellpadding=5>"; echo "<tr><td><center>Withdraw Gold</center></td><td><center><input type=text value=$playerinfo[bank] name=with size=12></center></td><td><center><input type=submit value=Withdraw></center></td></tr></form>"; ?> <form method=post action=bank.php?action=deposit> <? echo "<tr><td><center>Deposit Gold</center></td><td><center><input type=text value=$playerinfo[gold] name=dep size=12></center></td><td><center><input type=submit value=Deposit></center></td></tr></form>"; $tradeacct=mysql_query("select * from tradeaccount where id = '$playerinfo[id]'"); $tradeamt = mysql_fetch_array($tradeacct); if (!$tradeamt[gold]){} else { if ($tradeamt[gold]>0){ ?> <form method=post action=bank.php?action=tdeposit> <? echo "<tr><td><center>Deposit Trade Gold</center></td><td><center><input type=text value=$tradeamt[gold] name=dept size=12></center></td><td><center><input type=submit value=Deposit></center></td></tr></form>"; } } echo "</table>"; } //WITHDRAWING GOLD FROM BANK if ($action == withdraw){ if ($with > $playerinfo[bank] || $with <= 0){ echo "<center>You cannot withdraw that amount.</center>"; echo "<br><br><center>[<a href=bank.php>Back to the Bank</a>]</center>"; echo "<br><br><center>[<a href=main.php>Back to Your Hut</a>]</center>"; include("bottom.php"); exit; } if (ctype_digit($with) != true){ echo "<center>You need to enter a correct amount.</center>"; include("bottom.php"); exit; } mysql_query("update userdb set gold=gold+$with where id=$playerinfo[id]"); mysql_query("update userdb set bank=bank-$with where id=$playerinfo[id]"); echo "<center>You withdrew ".number_format($with)." gold."; } //DEPOSITING GOLD INTO BANK if ($action == deposit){ if ($dep > $playerinfo[gold] || $dep <= 0){ echo "<center>You cannot deposit that amount.</center>"; echo "<br><br><center>[<a href=bank.php>Back to the Bank</a>]</center>"; echo "<br><br><center>[<a href=main.php>Back to Your Hut</a>]</center>"; include("bottom.php"); exit; } if (ctype_digit($dep) != true){ echo "<center>You need to enter a correct amount.</center>"; include("bottom.php"); exit; } mysql_query("update userdb set gold=gold-$dep where id=$playerinfo[id]"); mysql_query("update userdb set bank=bank+$dep where id=$playerinfo[id]"); echo "<center>You deposited ".number_format($dep)." gold.</center>"; } //DEPOSITING TRADE GOLD INTO BANK if ($action == tdeposit){ $tradeacct=mysql_query("select * from tradeaccount where id = '$playerinfo[id]'"); $tradeamt = mysql_fetch_array($tradeacct); if ($dept > $tradeamt[gold] || $dept <= 0){ echo "<center>You cannot deposit that amount.</center>"; echo "<br><br><center>[<a href=bank.php>Back to the Bank</a>]</center>"; echo "<br><br><center>[<a href=main.php>Back to Your Hut</a>]</center>"; include("bottom.php"); exit; } if (ctype_digit($dept) != true){ echo "<center>You need to enter a correct amount.</center>"; include("bottom.php"); exit; } mysql_query("update tradeaccount set gold=gold-$dept where id=$playerinfo[id]"); mysql_query("update userdb set bank=bank+$dept where id=$playerinfo[id]"); echo "<center>You deposited ".number_format($dept)." gold.</center>"; } echo "<br><br><center>[<a href=main.php>Back to Your Hut</a>]</center>";} include("bottom.php"); } ?> And here is gameconfig.php <?php $dbh=mysql_connect ("xxx", "xxx", "xxx") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("xxx"); ini_set('session.gc_maxlifetime', 300); function sql_quote( $value ){ if( get_magic_quotes_gpc() ){ $value = stripslashes( $value );} //check if this function exists if( function_exists( "mysql_real_escape_string" ) ){ $value = mysql_real_escape_string( $value );} return $value; } if ($_SESSION["email"]){ $email=$_SESSION["email"]; $password=$_SESSION["password"]; } $res = mysql_query("SELECT * FROM userdb WHERE email = '$email'"); $playerinfo = mysql_fetch_array($res); mysql_free_result($res); $time = date("j\/m H:i:s"); $realtime = time(); $ip=$_SERVER['REMOTE_ADDR']; mysql_query("update userdb set active='$time' where email='$email'"); mysql_query("update userdb set active2='$realtime' where email='$email'"); mysql_query("update userdb set ipaddress='$ip' where email='$email'"); function jailerror($type, $email){ if($type == "jail"){ $res = mysql_query("SELECT * FROM userdb WHERE email='$email'"); $playerinfo = mysql_fetch_array($res); mysql_free_result($res); include("style5.css"); echo "<center><img src=\"images/dchaos.jpg\" border=0><br><br></center>"; echo "<font color=red>You are in jail for another $playerinfo[jailtime] days.<p>Jailed by: <b>$playerinfo[jail_by]</b> for reason: <b>$playerinfo[jail_reason]</b>"; } } function gem($type){ if($type == "c"){ echo "<img src=\"images/gem_crystal.gif\">";} if($type == "d"){ echo "<img src=\"images/gem_diamond.gif\">";} if($type == "e"){ echo "<img src=\"images/gem_emerald.gif\">";} if($type == "r"){ echo "<img src=\"images/gem_ruby.gif\">";} } function error($type){ if($type == "field"){ include "top.php"; echo "<font color=red>You have left fields blank or you have been inactive for more than 5 minutes and your session has expired. Please <a href=\"index.php\">relogin</a></font>"; include "bottom.php";} if($type == "password"){ include "top.php"; echo "<font color=red>Incorrect password. Please <a href=\"index.php\">relogin</a></font>"; include "bottom.php";} if($type == "jail"){ include "top.php"; $res = mysql_query("SELECT * FROM userdb WHERE email='$email'"); $playerinfo = mysql_fetch_array($res); echo "<font color=red>You are in jail for another $playerinfo[jailtime] days.<p>Jailed by: <b>$playerinfo[jail_by]</b> for reason: <b>$playerinfo[jail_reason]</b>"; include "bottom.php";} if($type == "verify"){ include "top.php"; echo "<font color=red>Verification required. Please <a href=verify.php>login</a> here.</font>"; include "bottom.php";} } $act2=$_GET["act2"]; if ($act2 == ""){$act2=$_POST["act2"];} $action=$_GET["action"]; if ($action == ""){$action=$_POST["action"];} $action2=$_GET["action2"]; $accept=$_GET["accept"]; $acceptaps=$_POST["acceptaps"]; $acted=$_POST["acted"]; $addgem=$_POST["addgem"]; $age=$_POST["age"]; $agility=$_POST["agility"]; $agilreq=$_POST["agilreq"]; $amount=$_GET["amount"]; if ($amount == ""){$amount=$_POST["amount"];} $announce=$_POST["announce"]; $ans=$_GET["ans"]; $ap=$_POST["ap"]; $arm=$_POST["arm"]; $arm2=$_POST["arm2"]; $arm_name=$_POST["arm_name"]; $arm_name2=$_POST["arm_name2"]; $armourer=$_POST["armourer"]; $armourer2=$_POST["armourer2"]; $attacks=$_POST["attacks"]; $bank=$_POST["bank"]; $bet=$_POST["bet"]; $bigcastle=$_POST["bigcastle"]; $blackid=$_POST["blackid"]; $body=$_POST["body"]; $box=$_GET["box"]; $buy=$_GET["buy"]; if ($buy == ""){$buy=$_POST["buy"];} $banner=$_POST["banner"]; $bannera=$_POST["bannera"]; $banneri=$_POST["banneri"]; $belief=$_POST["belief"]; $cannon=$_POST["cannon"]; $cannounce=$_POST["cannounce"]; $castact=$_POST["castact"]; $castle=$_POST["castle"]; $catapolt=$_POST["catapolt"]; $challenge=$_GET["challenge"]; $change=$_POST["change"]; $changeit=$_POST["changeit"]; $choice=$_POST["choice"]; $check=$_POST["check"]; $city=$_POST["city"]; $clan5=$_POST["clan5"]; $clan_days=$_POST["clan_days"]; $clan_exp=$_POST["clan_exp"]; $clanb=$_GET["clanb"]; $clan_gold=$_POST["clan_gold"]; $clan_infl=$_POST["clan_infl"]; $clan_recieve=$_POST["clan_recieve"]; if ($clanb == ""){$clanb=$_POST["clanb"];} $clant=$_GET["clant"]; $clantax=$_POST["clantax"]; $co=$_POST["co"]; $co2=$_POST["co2"]; $co_name=$_POST["co_name"]; $co_name2=$_POST["co_name2"]; $conf1=$_GET["conf1"]; $conf=$_GET["conf"]; if ($conf == ""){$conf=$_POST["conf"];} $confirm=$_GET["confirm"]; if ($confirm == ""){$confirm=$_POST["confirm"];} $coaccept=$_POST["coaccept"]; $codelnews=$_POST["codelnews"]; $coremove=$_POST["coremove"]; $coshop=$_POST["coshop"]; $costaff=$_POST["costaff"]; $cotreasury=$_POST["cotreasury"]; $counbrand=$_POST["counbrand"]; $country=$_POST["country"]; $crop=$_POST["crop"]; $crystals=$_POST["crystals"]; $credit=$_GET["credit"]; if ($credit == ""){$credit=$_POST["credit"];} $days=$_GET["days"]; if ($days == ""){$days=$_POST["days"];} $date=$_GET["date"]; $delete=$_POST["delete"]; $demote=$_GET["demote"]; $dep=$_POST["dep"]; $dept=$_POST["dept"]; $diamonds=$_POST["diamonds"]; $direction=$_GET["direction"]; $do=$_POST["do"]; $donorcreds=$_POST["donorcreds"]; $effect=$_POST["effect"]; $effect2=$_POST["effect2"]; $elixir=$_POST["elixir"]; $Email2=$_POST["Email2"]; $emblems=$_POST["emblems"]; $emeralds=$_POST["emeralds"]; $energy=$_POST["energy"]; $evasion=$_POST["evasion"]; $exercise=$_POST["exercise"]; $exp=$_POST["exp"]; $exp_lvl=$_POST["exp_lvl"]; $faith=$_POST["faith"]; $fg=$_POST["fg"]; $fromid=$_GET["fromid"]; $fs=$_POST["fs"]; if ($fromid == ""){$fromid=$_POST["fromid"];} $gender=$_POST["gender"]; $gold=$_POST["gold"]; $gtax=$_POST["gtax"]; $hacks=$_POST["hacks"]; $HP=$_POST["HP"]; $HP_left=$_POST["HP_left"]; $id=$_GET["id"]; if ($id == ""){$id=$_POST["id"];} $info=$_POST["info"]; $itemtag=$_POST["itemtag"]; $jailtime=$_POST["jailtime"]; $job=$_POST["job"]; $justnews=$_GET["justnews"]; $keys=$_GET["keys"]; if ($keys == ""){$keys=$_POST["keys"];} $lcrystal=$_POST["lcrystal"]; $ldiamond=$_POST["ldiamond"]; $lemerald=$_POST["lemerald"]; $level=$_GET["level"]; if ($level == ""){$level=$_POST["level"];} $level2=$_GET["level2"]; if ($level2 == ""){$level2=$_POST["level2"];} $lvlreq=$_POST["lvlreq"]; $levelreward=$_POST["levelreward"]; $lopal=$_POST["lopal"]; $losses=$_POST["losses"]; $lruby=$_POST["lruby"]; $lucky=$_POST["lucky"]; $lvlreq=$_POST["lvlreq"]; $Mana=$_POST["Mana"]; $mcrystal=$_POST["mcrystal"]; $mdiamond=$_POST["mdiamond"]; $membertax=$_POST["membertax"]; $membo=$_POST["membo"]; $memerald=$_POST["memerald"]; $message=$_POST["message"]; $mod=$_POST["mod"]; $mod2=$_POST["mod2"]; $moddelnews=$_POST["moddelnews"]; $moderator=$_POST["moderator"]; $moderator2=$_POST["moderator2"]; $mod_name=$_POST["mod_name"]; $mod_name2=$_POST["mod_name2"]; $mopal=$_POST["mopal"]; $mruby=$_POST["mruby"]; $msg=$_POST["msg"]; $mythore=$_POST["mythore"]; $mythril=$_POST["mythril"]; $name=$_GET["name"]; if ($name == ""){$name=$_POST["name"];} $nectar=$_POST["nectar"]; $newann=$_POST["newann"]; $newdet=$_POST["newdet"]; $newname=$_POST["newname"]; $news=$_POST["news"]; $newscreds=$_POST["newscreds"]; $newsig=$_POST["newsig"]; $npccreds=$_POST["npccreds"]; $npcid=$_GET["npcid"]; $nickname=$_POST["nickname"]; $note=$_POST["note"]; $number=$_POST["number"]; $opals=$_POST["opals"]; $open=$_GET["open"]; $option=$_GET["option"]; $otherclanid=$_GET["otherclanid"]; $otherclanname=$_GET["otherclanname"]; $owner=$_POST["owner"]; $owner_name=$_POST["owner_name"]; $padmin=$_POST["padmin"]; $padmin2=$_POST["padmin2"]; $page=$_GET["page"]; $pass=$_GET["pass"]; if ($pass == ""){$pass=$_POST["pass"];} $password2=$_POST["password2"]; $peqid=$_GET["peqid"]; if ($peqid == ""){$peqid=$_POST["peqid"];} $per2=$_POST["per2"]; $phrase=$_POST["phrase"]; $postid=$_GET["postid"]; $potions=$_POST["potions"]; $power=$_POST["power"]; $price=$_POST["price"]; $promote=$_GET["promote"]; if ($promote == ""){$promote=$_POST["promote"];} $race=$_POST["race"]; $reason=$_GET["reason"]; if ($reason == ""){$reason=$_POST["reason"];} $redirect2=$_POST["redirect2"]; $removeid=$_GET["removeid"]; $repeat=$_POST["repeat"]; $rexp=$_POST["rexp"]; $rexpneed=$_POST["rexpneed"]; $reward=$_POST["reward"]; $rkeys=$_POST["rkeys"]; $rubys=$_POST["rubys"]; $scrystal=$_POST["scrystal"]; $sdiamond=$_POST["sdiamond"]; $semerald=$_POST["semerald"]; $sendid=$_GET["sendid"]; if ($sendid == ""){$sendid=$_POST["sendid"];} $sendto=$_POST["sendto"]; $senduser=$_GET["senduser"]; if ($senduser == ""){$senduser=$_POST["senduser"];} $shinu=$_POST["shinu"]; $showid=$_GET["showid"]; $skill=$_POST["skill"]; $so=$_GET["so"]; $sockets=$_POST["sockets"]; $sopal=$_POST["sopal"]; $sruby=$_POST["sruby"]; $status=$_POST["status"]; $status1=$_POST["status1"]; $step=$_GET["step"]; if ($step == ""){$step=$_POST["step"];} $strength=$_POST["strength"]; $strreq=$_POST["strreq"]; $subject=$_POST["subject"]; $syphon=$_POST["syphon"]; $tact=$_POST["tact"]; $tact2=$_POST["tact2"]; $tactician=$_POST["tactician"]; $tactician2=$_POST["tactician2"]; $tact_name=$_POST["tact_name"]; $tact_name2=$_POST["tact_name2"]; $tax=$_POST["tax"]; $text=$_POST["text"]; $text1=$_POST["text1"]; $text2=$_POST["text2"]; $text3=$_POST["text3"]; $toid=$_GET["toid"]; if ($toid == ""){$toid=$_POST["toid"];} $topicid=$_GET["topicid"]; $total=$_POST["total"]; $total2=$_POST["total2"]; $tid=$_GET["tid"]; $timestampopt=$_POST["timestampopt"]; $topicid=$_GET["topicid"]; $trader=$_POST["trader"]; $tradeto=$_GET["tradeto"]; if ($tradeto == ""){$type=$_POST["tradeto"];} $tradeto2=$_POST["tradeto2"]; $truceaction=$_GET["truceaction"]; $truceyn=$_GET["truceyn"]; $ts=$_POST["ts"]; $type=$_GET["type"]; if ($type == ""){$type=$_POST["type"];} $user=$_POST["user"]; $view=$_GET["view"]; if ($view == ""){$view=$_POST["view"];} $vote=$_GET["vote"]; $wall=$_POST["wall"]; $wco=$_POST["wco"]; $wid=$_GET["wid"]; $wins=$_POST["wins"]; $with=$_POST["with"]; $xco=$_POST["xco"]; $yco=$_POST["yco"]; $f_id=$_POST["f_id"]; $f_amnt=$_POST["f_amnt"]; $small_package=$_POST["small_package"]; $medium_package=$_POST["medium_package"]; $large_package=$_POST["large_package"]; $clan_package=$_POST["clan_package"]; $custom_packages=$_POST["custom_packages"]; $packages=$_POST["packages"]; $donated=$_POST["donated"]; $justdonated=$_POST["justdonated"]; $totaldonated=$_POST["totaldonated"]; $rank=$_POST["rank"]; $d_id=$_GET["d_id"]; if ($d_id == ""){$d_id=$_POST["d_id"];} $f_id=$_GET["f_id"]; if ($f_id == ""){$f_id=$_POST["f_id"];} ?> The previous gives me the following: Now as you can tell, the code was simply cut off an returned to html in the middle of this command: if($playerinfo[jailtime] > 0){ What is it that can cause that?
  7. guys. This code WORKS on other sites. I am pretty sure it is some kind of configuration issue. I just don't know WHAT. However, here is the code for head.php <?php require('gameconfig.php'); $title="Welcome to Immortalix.net"; $players = mysql_query("select id from userdb where id != 1"); $players = mysql_num_rows($players); $active = $realtime-500; $select_act = mysql_query("select * from userdb where active2>$active && active != '-Never-' order by active2 desc"); $select_chat = mysql_query("select * from userdb where ccheck>$active order by ccheck desc"); $playersonline = mysql_num_rows($select_act); $inchat = mysql_num_rows($select_chat); $view = mysql_fetch_array(mysql_query("select clicks from economy order by id desc limit 1")); $today = date("Y-m-d"); $signups2 = mysql_query("select * from tbl_dailystat where date='$today'"); $signups = mysql_fetch_array($signups2); $balls = $view[clicks]?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Immortalix - A Free Online MMORPG/PBBG</title> <meta name="keywords" content=""> <meta name="description" content=""> <link href="default.css" rel="stylesheet" type="text/css"> </head> <body> <table width="982" border="0" align="center" cellpadding="0" cellspacing="0" class="bg1"> <tr> <td><table width="982" border="0" align="center" cellpadding="0" cellspacing="0" class="bg2"> <tr> <td><table width="950" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="273"><img src="images/homepage06.jpg" alt="" width="273" height="141"></td> <td width="677"><img src="images/homepage07.jpg" alt="" width="677" height="141"></td> </tr> <tr> <td colspan="2" class="bg3" style="height:50px;"><table width="950" border="0" cellspacing="0" cellpadding="0" style="height:50px;"> <tr> <td width="33"> </td> <td valign="middle" class="text2"><a href="#." class="link1"></a><a href="#" class="link1"></a><img src="images/spacer.gif" alt="" width="1" height="1" hspace="15"><a href="#" class="link1"></a><img src="images/spacer.gif" alt="" width="1" height="1" hspace="15"><a href="#" class="link1"></a><img src="images/spacer.gif" alt="" width="1" height="1" hspace="15"><a href="#" class="link1"></a><img src="images/spacer.gif" alt="" width="1" height="1" hspace="15"><a href="#" class="link1"></a> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><a href="index.php" class="link1">Home</a></td> <td><img src="images/subpage1_02.jpg" alt="" width="4" height="16" hspace="15"></td> <td><a href="signup.php" class="link1">Register</a></td> <td><img src="images/subpage1_02.jpg" alt="" width="4" height="16" hspace="15"></td> <td><a href="verify.php" class="link1">Verify New Account</a></td> <td><img src="images/subpage1_02.jpg" alt="" width="4" height="16" hspace="15"></td> <td><a href="gamerules.php" class="link1">Game Rules</a></td> <td><img src="images/subpage1_02.jpg" alt="" width="4" height="16" hspace="15"></td> <td><a href="help.php" class="link1">Help Files</a></td> <td><img src="images/subpage1_02.jpg" alt="" width="4" height="16" hspace="15"></td> <td><a href="staff.php" class="link1">Staff</a></td> <td><img src="images/subpage1_02.jpg" alt="" width="4" height="16" hspace="15"></td> <td><a href="contact.php" class="link1">Contact</a></td> <td><img src="images/subpage1_02.jpg" alt="" width="4" height="16" hspace="15"></td> </tr> </table></td> <td width="108" align="right" class="text1"><script language="JavaScript" type="text/javascript" src="date.js"></script></td> <td width="32"> </td> </tr> </table></td> </tr> </table> <table width="950" border="0" align="center" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="181"><table width="181" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="text2" style="background-image:url(images/homepage09.jpg); height:40px;"><table width="181" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="15"><img src="images/spacer.gif" alt="" width="15" height="40"></td> <td width="166" class="text2">Site Login</td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><form name="form1" method="post" action="check.php"> <table width="155" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2" class="text1" style="height:25px;">Email:</td> </tr> <tr> <td colspan="2"><input name="email" type="text" class="input1"></td> </tr> <tr> <td colspan="2" class="text1" style="height:25px;">Password:</td> </tr> <tr> <td colspan="2"><input name="password" type="password" class="input1"></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td width="115"><p><a href="signup.php" class="link1">No Account?<br> Register for Free!</a></p> </td> <td width="43" align="right"><input name="imageField" type="image" src="images/homepage21a.jpg" align="right"></td> </tr> <tr> <td colspan="2"> </td> </tr> </table> </form></td> </tr> </table></td> </tr> <tr> <td><img src="images/homepage11.jpg" alt="" width="181" height="8"></td> </tr> </table> <table width="181" border="0" cellspacing="0" cellpadding="0"> <tr> <td style="background-image:url(images/homepage09.jpg); height:40px;"><table width="181" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="15"><img src="images/spacer.gif" alt="" width="15" height="40"></td> <td width="166" class="text2">Latest Online Chat</td> </tr> </table></td> </tr> <td bgcolor="#000000"> <table cellpadding="4" cellspacing="4"><tr><td> <?php $chatpull = mysql_query("SELECT * FROM chat_lines where staff != 1 and private = '0' ORDER BY timesent DESC, id ASC limit 0,10"); echo "<font face=Verdana size=1>"; while ($display=mysql_fetch_array($chatpull)){ $display[message] = str_replace("`namey`", "$playerinfo[username]", $display[message]); $display[username] = str_replace("<a href=view.php?id=$display[userid] target=_parent>", "", $display[username]); if(!$display[username]){ echo "</font>$display[message]</font></u></i></b></b></em></i></u></strike></b></i></u></strike></font></span><br>";} else{ $find = mysql_query("select * from userdb where id='$display[userid]'"); $find2 = mysql_fetch_array($find); if ($find2[status] == "Member") { echo "</font><font color=#808080>$display[username]</font>> $display[message]</font></u></b></em></i></u></strike></b></i></u></strike></font></i></b></span><br>";} else { echo "</font>$display[username]> $display[message]</font></u></b></em></i></u></strike></b></i></u></strike></font></i></b></span><br>"; }}}?> </td></tr></table> <tr> <td><img src="images/homepage11.jpg" alt="" width="181" height="8"></td> </tr> </table> </td> <td width="589"><table width="589" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="589" style="background-image:url(images/homepage13.jpg); height:40px;"><table width="181" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="15"><img src="images/spacer.gif" alt="" width="26" height="40"></td> <td width="166" class="text2"><? echo"$title"; ?> </td> </tr> </table></td> </tr>
  8. Wish that was the problem. All tags are in their proper place. The site works fine on it's current host. It is only on the new server I am having this issue.
  9. here is the code for the top part of index.php. <?php $title="Welcome to Immortalix.net"; include "head.php"; ?> <tr> <td><img src="images/titlepic.jpg"></td> And here is the results before the image and the rest of my page displays. Now that I look at it. It appears to be trying to display the contents of my targets of my urls on the page. What would do that?
  10. I am moving my site to a home web server and while testing it, all of my includes seem to be showing up as code, and not executing properly. I am using php5.2.6, Apache 2.2 Mysql 5.0.67 and Activeperl 5.10. I have tried editing the includes_path in the php.ini file, but no luck. Any suggestions?
  11. I figured out the problem and the solution. Say I am at coordinates 0,0 when I begin my clicking East. The page was still loading every time I clicked so the x cord just incremented each time but the source was the page with 0,0. By the time the page got a full load in, x could be 500. So, knowing the source link is the same every click, I had it compute the new value of x BEFORE the link and added a &step=$newx to the end of the link. I then had the user data updated with the step value instead. That way the static data in the link gets passed no matter how many times the link is clicked.
  12. I have a bit of a problem I had asked for help on a few days ago and while the solution suggested works to an extent, it causes a unsightly white flash from the page load. I have a game module that allows players to move about on quests and they are randomly attacked by creatures. The problem is that when people with slower connections click really fast, the can get to their destinations without being attacked at all. Here is the code for the link that keeps getting abused. echo "<p><table border=0 align=center><tr><td></td><td>"; if ($questrecord[uy] > 0){ echo "<center><a href=outlands.php?action=up>North</a></center>"; } else{ echo "<center>Up</center>"; } echo "</td><td></td></tr><tr><td>"; if ($questrecord[ux] > 0){ echo "<center><a href=outlands.php?action=left>West</a></center>"; } else{ echo "<center>Left</center>"; } echo "</td><td>"; echo "</td><td>"; if ($questrecord[ux] < 1000){ echo "<center><a href=outlands.php?action=right>East</a></center>"; } else{ echo "<center>Right</center>"; } echo "</td></tr><tr><td></td><td>"; if ($questrecord[uy] < 1000){ echo "<center><a href=outlands.php?action=down>South</a></center>"; } else{ echo "<center>Down</center>"; } echo "</td><td></td></tr></table>"; And here is the code it calls: // moving page if ($action == "up"){ //Chance of monster $mrand=rand(1,100); if ($mrand<=25){ questattack($playerinfo); } else{ mysql_query("Update outland_user_data set uy=uy-1 where id='$playerinfo[id]'"); } } if ($action == "down"){ //Chance of monster $mrand=rand(1,100); if ($mrand<=25){ questattack($playerinfo); } else{ mysql_query("Update outland_user_data set uy=uy+1 where id='$playerinfo[id]'"); } } if ($action == "left"){ //Chance of monster $mrand=rand(1,100); if ($mrand<=25){ questattack($playerinfo); } else{ mysql_query("Update outland_user_data set ux=ux-1 where id='$playerinfo[id]'"); } } if ($action == "right"){ //Chance of monster $mrand=rand(1,100); if ($mrand<=25){ questattack($playerinfo); } else{ mysql_query("Update outland_user_data set ux=ux+1 where id='$playerinfo[id]'"); } } So. Why is the movement getting called but not the attack?
  13. That did it! Thanks!
  14. I have a php variable ($id) that I am trying to pass in a url using the javascript window.location function, but it is not working properly. Can I get some help with my formatting? ?> <script> window.location="outlands_move.php?step=up&id=$id" </script> <?
  15. Thanks. I'll try that.
  16. I have a game that uses links to move about an area. After moving a random number determines if a creature attacks the player. Apparently if the movement links are clicked rapidly, players can avoid being attacked alltogether. Is there a way to prevent this? If you want the code, I'll give it, but it is rather long.
  17. works on firefox and IE. I don't know about other cell phone browsers.
  18. I have a game written in php that stores login data in session variables. When these variables are not found, it returns an error code for a blank field. The data is entered into a form and retrieved via $_POST. session_start(); $email=$_POST['email']; $password=$_POST['password']; function error($type){ if($type == "field"){ include "top.php"; echo "<font color=red>You have left fields blank or you have been inactive for more than 5 minutes and your session has expired. Please <a href=\"index.php\">relogin</a></font>"; include "bottom.php";} } if($email == "" || $password == ""){ error("field"); exit; } I have a user using a NOKIA 7650 and using Doris Browser 1.8 that gets the blank field error on attempting to login. My only guess is that somehow the variables are not retrieving properly. Any suggestions?
  19. OK An update for those who are interested. I solved the problem by removing the meta tags from the html portion of my page. Apparently Firefox sends links twice when they are in there. This is what I deleted. <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="keywords" content=""> <meta name="description" content=""> So the problem is solved and I that everyone for their help. It got me pointed in the right direction.
  20. This appears to be a firefox issue. It is clicking the entry twice which is causing the bug. Anybody know a workaround for it?
  21. Yeah, I stripped out the top.php call and it works. Great. That file is a nightmare. At least I know where to look now.
  22. I've tried everything I can think of and nothing seems to fix it.
  23. I have and it is. Now for a twist. I stripped out all the code to make sure I narrowed the problem down. The $_GET is in the included gameconfig.php. <?php session_start(); include("gameconfig.php"); $title = "Local Training Dungeon- Battle Monster"; if(!$email || !$password){ error("field"); exit;} if($playerinfo[jailtime] > 0){ error("jail"); exit;} if($playerinfo[password] != $password){ error("password");} else{ include("top.php"); //Get player location $duser2 = mysql_query("SELECT * FROM tbl_dungeon_user WHERE id='$playerinfo[id]'"); $duser = mysql_fetch_array($duser2); //get monster record $dnpcgrid2 = mysql_query("SELECT * FROM tbl_dungeon_npcgrid WHERE id='$npcid'") or die(mysql_error()); $dnpcgrid = mysql_fetch_array($dnpcgrid2); $dnpc2 = mysql_query("SELECT * FROM tbl_dungeon_npc WHERE id='$dnpcgrid[npcid]'"); $dnpc = mysql_fetch_array($dnpc2); echo"test1<br>"; print_r($dnpcgrid); print_r($dnpc); echo"test2<br>"; //PERFORM CHECKS ON BOTH USER AND NPC if(!$dnpcgrid){ echo "<center>Either you were too slow and this NPC has now been defeated by someone else, or this NPC doesn't exist!"; echo "<br><br><center>[<a href=game-dungeon.php?action=roam>Back to Grid Square</a>]</center>"; include("bottom.php"); exit; } // mysql_query("DELETE FROM tbl_dungeon_npcgrid WHERE id='$npcid'"); include("bottom.php"); }?> This code results in the following. test1 Array ( [0] => 12414754 [id] => 12414754 [1] => 34 [xco] => 34 [2] => 50 [yco] => 50 [3] => 1 [zco] => 1 [4] => 39 [npcid] => 39 [5] => 276 [level] => 276 ) Array ( [0] => 39 [id] => 39 [1] => Stone Giant [name] => Stone Giant [2] => Stone Fist [wepname] => Stone Fist [3] => [image] => [4] => 270 [level] => 270 [5] => 310 [level2] => 310 [6] => 30000 [hp] => 30000 [7] => 2200 [agility] => 2200 [8] => 2195 [strength] => 2195 [9] => 1800 [armor] => 1800 [10] => 9500 [damage] => 9500 [11] => 90 [gold] => 90 [12] => 90 [exp] => 90 ) test2 Now, if I uncomment the delete query: and do it on the EXACT SAME record. <?php session_start(); include("gameconfig.php"); $title = "Local Training Dungeon- Battle Monster"; if(!$email || !$password){ error("field"); exit;} if($playerinfo[jailtime] > 0){ error("jail"); exit;} if($playerinfo[password] != $password){ error("password");} else{ include("top.php"); //Get player location $duser2 = mysql_query("SELECT * FROM tbl_dungeon_user WHERE id='$playerinfo[id]'"); $duser = mysql_fetch_array($duser2); //get monster record $dnpcgrid2 = mysql_query("SELECT * FROM tbl_dungeon_npcgrid WHERE id='$npcid'") or die(mysql_error()); $dnpcgrid = mysql_fetch_array($dnpcgrid2); $dnpc2 = mysql_query("SELECT * FROM tbl_dungeon_npc WHERE id='$dnpcgrid[npcid]'"); $dnpc = mysql_fetch_array($dnpc2); echo"test1<br>"; print_r($dnpcgrid); print_r($dnpc); echo"test2<br>"; //PERFORM CHECKS ON BOTH USER AND NPC if(!$dnpcgrid){ echo "<center>Either you were too slow and this NPC has now been defeated by someone else, or this NPC doesn't exist!"; echo "<br><br><center>[<a href=game-dungeon.php?action=roam>Back to Grid Square</a>]</center>"; include("bottom.php"); exit; } mysql_query("DELETE FROM tbl_dungeon_npcgrid WHERE id='$npcid'"); include("bottom.php"); }?> I get the following results: test1 test2 Either you were too slow and this NPC has now been defeated by someone else, or this NPC doesn't exist! [back to Grid Square] Now Can someone tell me why?
  24. Anybody else? This is driving me crazy!
  25. No. I am looking at the record in the database. I know it is there. And if I remove the delete query, it finds it EVERY time.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.