malcome_thompson Posted May 29, 2008 Share Posted May 29, 2008 Hello, I am trying to get a game running, www.chaoticstars.com For some reason, it won't retrieve player info from the db, and I cannot figureo ut why. There is a db connect in 2 files, and I have all the db info correct in both, but it won't pull the info. When you sign up, it will save the info to the db, but when you log in, it won't gather the player info. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/107722-db-connect/ Share on other sites More sharing options...
peranha Posted May 29, 2008 Share Posted May 29, 2008 We need to see some code to help you Quote Link to comment https://forums.phpfreaks.com/topic/107722-db-connect/#findComment-552224 Share on other sites More sharing options...
malcome_thompson Posted May 29, 2008 Author Share Posted May 29, 2008 This is one of them: <? $pagename = $_SERVER['REQUEST_URI']; $pagename = substr($pagename,1); $dbh=mysql_connect ("localhost", "chaotic_StaR", "stone") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("chaotic_StaR_db"); $uri = $REQUEST_URI; $playerinfo = mysql_fetch_array(mysql_query("select * from userdb where email='$email'")); mysql_query("update userdb set page='$uri' where id='$playerinfo[id]'"); if ($playerinfo[status] != "Owner" && $playerinfo[status] != "Manager" && $playerinfo[id] != "8"){ ?> <SCRIPT LANGUAGE="Javascript"><!-- // *********************************************** // AUTHOR: WWW.CGISCRIPT.NET, LLC // URL: http://www.cgiscript.net // Use the script, just leave this message intact. // Download your FREE CGI/Perl Scripts today! // ( http://www.cgiscript.net/scripts.htm ) // *********************************************** var isNS = (navigator.appName == "Netscape") ? 1 : 0; var EnableRightClick = 0; if(isNS) document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP); function mischandler(){ if(EnableRightClick==1){ return true; } else {return false; } } function mousehandler(e){ if(EnableRightClick==1){ return true; } var myevent = (isNS) ? e : event; var eventbutton = (isNS) ? myevent.which : myevent.button; if((eventbutton==2)||(eventbutton==3)) return false; } function keyhandler(e) { var myevent = (isNS) ? e : window.event; if (myevent.keyCode==96) EnableRightClick = 1; return; } document.oncontextmenu = mischandler; document.onkeypress = keyhandler; document.onmousedown = mousehandler; document.onmouseup = mousehandler; //--> </script> <script language="JavaScript"><!-- //script by Clarence Eldefors http://www.cerebuswebmaster.com var speed = 20; var step = 5; var hide = 10000; var moveto = 500; // Do not edit below this line var left = 0; function movein(){ if (document.layers) { document.layers['message'].pageX = window.pageXOffset + left; left+=step; if(left<moveto){ setTimeout('movein()',speed); } else { setTimeout('closemessage()',hide); } } else{ document.getElementById('message').style.left=left+'px'; left+=step; if(left<moveto){ setTimeout('movein()',speed); } else { setTimeout('closemessage()',hide); } } } function closemessage(){ if (document.layers) {document.layers['message'].visibility='hidden';} else{document.getElementById('message').style.visibility='hidden';} } //--></script> <style type="text/css" media="screen"><!-- #message {top:200px; border:1px solid black; width:200px;background-color:red;padding:4px; position:absolute;} --> </style> <? } ?> And this is the other: <? $time_start = microtime(true); $ip = $REMOTE_ADDR; include("dateinfo.php"); include("patch.php"); require("privates/thedb2.php"); ?> <script type="text/javascript"> /*********************************************** * Local Time script- © Dynamic Drive (http://www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit http://www.dynamicdrive.com/ for this script and 100s more. ***********************************************/ //CHANGE SERVER RESULT TO TEXT var weekdaystxt=["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] var daystxt=["31st", "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th", "21st", "22nd", "23rd", "24th", "25th", "26th", "27th", "28th", "29th", "30th"] var monthtxt=["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] function showLocalTime(container, servermode, offsetMinutes, displayversion){ if (!document.getElementById || !document.getElementById(container)) return this.container=document.getElementById(container) this.displayversion=displayversion var servertimestring=(servermode=="server-php")? '<? print date("F d, Y H:i:s", time())?>' : (servermode=="server-ssi")? '<!--#config timefmt="%B %d, %Y %H:%M:%S"-->' : '<%= Now() %>' this.localtime=this.serverdate=new Date(servertimestring) this.localtime.setTime(this.serverdate.getTime()+offsetMinutes*60*1000) //add user offset to server time this.updateTime() this.updateContainer()} showLocalTime.prototype.updateTime=function(){ var thisobj=this this.localtime.setSeconds(this.localtime.getSeconds()+1) setTimeout(function(){thisobj.updateTime()}, 1000)} //update time every second showLocalTime.prototype.updateContainer=function(){ var thisobj=this if (this.displayversion=="long") this.container.innerHTML=this.localtime.toLocaleString() else{ var hour=this.localtime.getHours() var minutes=this.localtime.getMinutes() var seconds=this.localtime.getSeconds() //FOR WHEN SEC/MIN/HR OVER I.E DAILY RESET if (seconds < 1){ var resets=00 var resetm=(59-minutes)+1 var reseth=23-hour if (resetm > 59){ var resetm=00 var reseth=(23-hour)+1}} //IF NO VALUE IS '00' else{ var reseth=23-hour var resetm=59-minutes var resets=60-seconds} //***ADD THE AM/PM PART IF ON 12HR SETTING--- ALSO ADD "+ampm+" INTO DISPLAY LINE BELOW //var ampm=(hour>=12)? "PM" : "AM" //GET SERVER FIGURE AND FILTER THROUGH LISTS AT START var dayofweek=weekdaystxt[this.serverdate.getDay()] var day=daystxt[this.serverdate.getDate()] var month=monthtxt[this.serverdate.getMonth()] var year=[this.serverdate.getFullYear()] this.container.innerHTML="<font color=FF0000>Game Time:</font> "+formatField(hour, 1)+":"+formatField(minutes)+":"+formatField(seconds)+" <br><font color=FF0000>Main Reset In:</font> "+formatField(reseth, 1)+":"+formatField(resetm)+":"+formatField(resets)} setTimeout(function(){thisobj.updateContainer()}, 1000)} //update container every second function formatField(num, isHour){ //SWITCH TO 12/24HR STYLE //if (typeof isHour!="undefined"){ //var hour=(num>12)? num-12 : num //return (hour==0)? 12 : hour} //END SWITCH TO 12/24HR return (num<=9)? "0"+num : num} //if this is minute or sec field </script> <? $totalpoints =(($playerinfo[level]*1000)+$playerinfo[gold]+$playerinfo[bank]+$playerinfo[clan_infl]+($playerinfo[battleswon]-$playerinfo[battleslost]*100)+($playerinfo[age]*10000)+$playerinfo[exp]+$playerinfo[clan_gold]+$playerinfo[clan_exp]+($playerinfo[clan_days]*10000)-$playerinfo[clan_recieve]+($playerinfo[topiccount]*5000)+($playerinfo[nectar]*10000)+($playerinfo[lucky]*100000)); mysql_query("update userdb set totalpoints='$totalpoints' where id='$playerinfo[id]'"); $ctotalpoints = ($playerinfo[crystals]*5)+($playerinfo[lcrystal]*10)+($playerinfo[scrystal]*20)+($playerinfo[mcrystal]*30); mysql_query("update userdb set ctotalpoints='$ctotalpoints' where id='$playerinfo[id]'"); $email = $_SESSION['email']; $password = $_SESSION['password']; /* if(stristr($HTTP_USER_AGENT,'mediapartners-google')) { $email = 'googlebotian'; $password = 'googleification'; if ($data > $loadcap/2) { sleep(50); } } */ if (!$playerfields) { $playerfields = '*'; }elseif($playerfields == 'none'){ $playerfields = 'password,male,female,verified,jailtime,jail_by,jail_reason,email,age,chatban,cbanreason,username,id,donated,rank,exp,exp_lvl,gold,bank,hacks,nectar,hp_left,hp,status,job,totalpoints,tprank,city,style,level,race,skill,attempts,faith,muse,energy,Mana,mine_att,strength,agility,rdefense,lcheck,vote,clan,chat,vote1,vote2,vote3,vote4,vote5,vote6,vote7,vote8,vote9,vote10,vote11,vote12,vote13'; }elseif($playerfields != 'none'){ $playerfields .= 'password,male,female,verified,jailtime,jail_by,jail_reason,email,age,chatban,cbanreason,username,id,donated,rank,exp,exp_lvl,gold,bank,hacks,nectar,hp_left,hp,status,job,totalpoints,tprank,city,style,level,race,skill,attempts,faith,muse,energy,Mana,mine_att,strength,agility,rdefense,lcheck,vote,clan,chat,vote1,vote2,vote3,vote4,vote5,vote6,vote7,vote8,vote9,vote10,vote11,vote12,vote13'; } $downreason = ''; $playerinfo = mysql_fetch_array(mysql_query("SELECT * FROM userdb WHERE email = '$email'")); if($playerinfo[status] == "Manager" || $playerinfo[status] == "VManager" && $playerinfo[job] == "Coder"){ $downreason = ''; } if ($downreason) { echo "<link href=styles/style1.css type=text/css rel=StyleSheet><center><br><br></center><font color=red><b>Game Frozen</b><br>The game is down while $downreason. Please wait patiently.</font>"; exit; } if ($playerinfo[donated] < 20) { while ($data > $loadcap) { $reps++; sleep(1); $data = serverload(); if ($reps == 4) break; } } if(!$email || !$password){ echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center><br><br></center><font color=red><b>Error Code 1</b><br>Your session has timed out. Please <a href=index.php>relogin</a>.</font>'; exit; } if($playerinfo[password] != $password){ echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center><br><br></center><font color=red><b>Error Code 2</b><br>Incorrect email or password. Please <a href=index.php>relogin</a>.</font>'; exit; } if($playerinfo[verified] != "Y"){ echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center><br><br></center><font color=red><b>Error Code 3</b><br> Verification required. Please <a href=verify.php>verify</a> here.</font>'; exit; } if($playerinfo[jailtime] > 0){ echo "<link href=styles/style1.css type=text/css rel=StyleSheet><center><br><br></center><body text=#800000 bgcolor=#000000></body><font face=Arial><font color=red><b>Error Code 4</b><br>You are in jail for another $playerinfo[jailtime] days.<p>Jailed by: <b>$playerinfo[jail_by]</b> for reason: <b>$playerinfo[jail_reason]</b>"; exit; } $ipbancheck = mysql_num_rows(mysql_query("select * from bannedip where ipaddress='$ip'")); if($ipbancheck > 0){ echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center><br><br></center><font color=red><b>Error Code 5</b><br>Your IP is banned. To have this ban reviewed please <a href=index.php?action=support>Contact Support</a>.</font>'; exit; } if (($HTTP_X_FORWARDED_FOR == "67.171.23.92" || $REMOTE_ADDR == "67.171.23.92" || $HTTP_X_FORWARDED_FOR == "66.235.203.202" || $REMOTE_ADDR == "66.235.203.202") && $playerinfo[email] != 'zereth@comcast.net') { echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center><br><br></center><font color=red><b>Error Code 5</b><br>Your account is under the effect of a custom ban. To have this ban reviewed please <a href=index.php?action=support>Contact Support</a>.</font>'; exit; } $emailbancheck = mysql_num_rows(mysql_query("select email from bannedip where email='$email'")); if($emailbancheck > 0){ echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center><br><br></center><font color=red><b>Error Code 6</b><br>Your email address is banned. To have this ban reviewed please <a href=index.php?action=support>Contact Support</a>.</font>'; exit; } //if($playerinfo[id]> 3){ // // echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center><br><br></center><font color=red><b>Error Code 7</b><br>Game is currently down while we move server, thanks.</font>'; // // exit; // // } if ($playerinfo[chatban] > 0 && $title == "Chat"){ echo "You are banned from chat for $playerinfo[chatban] days for $playerinfo[cbanreason]."; exit; } if (eregi('sqrpg',$playerinfo[username])) { mysql_query("update userdb set username='No Advertising' where id='$playerinfo[id]'"); } if (eregi('www.',$playerinfo[username])) { mysql_query("update userdb set username='No Advertising' where id='$playerinfo[id]'"); } if (eregi('.com',$playerinfo[username])) { mysql_query("update userdb set username='No Advertising' where id='$playerinfo[id]'"); } if (eregi('.c0m',$playerinfo[username])) { mysql_query("update userdb set username='No Advertising' where id='$playerinfo[id]'"); } if (eregi('. c o m',$playerinfo[username])) { mysql_query("update userdb set username='No Advertising' where id='$playerinfo[id]'"); } if (eregi('<',$playerinfo[username])) { mysql_query("update userdb set username='No HTML' where id='$playerinfo[id]'"); } if (eregi('>',$playerinfo[username])) { mysql_query("update userdb set username='No HTML' where id='$playerinfo[id]'"); } if ($playerinfo[id] == "1") { mysql_query("update userdb set username='The Wasted 1' where id='1'"); mysql_query("update userdb set status='Owner' where id='1'"); } if (!$dest) { mysql_query("update fishdb set outonboat='N' where owner='$playerinfo[id]'"); } mysql_query("update userdb set active='$time', active2='$realtime', ipaddress='$ip', clickstoday=clickstoday+1 where email='$email'"); mysql_query("update userdb set inactive='0' where id='$playerinfo[id]'"); $rankname = array( "Peasant", "Valet", "Squire", "Knight", "Lord", "Dol", "Earl", "Count", "Thane", "Duke", "Archduke", "Royal"); $rankypanky = $playerinfo[rank]; $merank = $rankname[$rankypanky]; $exps = number_format($playerinfo[exp]); $expneed = number_format($playerinfo[exp_lvl]); $gold2 = number_format($playerinfo[gold]); $bank = number_format($playerinfo[bank]); $hacks = number_format($playerinfo[hacks]); $nectar = number_format($playerinfo[nectar]); $hp_left = number_format($playerinfo[hp_left]); $hp = number_format($playerinfo[hp]); $energy = number_format($playerinfo[energy]); $ebank = number_format($playerinfo[ebank]); $Mana = number_format($playerinfo[Mana]); $mineatt = number_format($playerinfo[mine_att]); $faith = number_format($playerinfo[faith]); if ($playerinfo[hp_left] == 0) { $status2 = "<img src=image/Misc/Skull.gif alt=Dead>"; } if ($playerinfo[donated] > 0) { $status2 .= "<img src=image/donator$playerinfo[donated].gif alt=\"Noble $merank ($playerinfo[donated])\">"; } //ranks $goldcheck = Mysql_query("select * from userdb order by ((level*10000)+gold+(bullion*1000000)+clan_infl+(battleswon-battleslost*100)+(age*10000)+exp+clan_gold+clan_exp+(clan_days*10000)-clan_recieve+(topiccount*5000)+(nectar*10000)+(lucky*100000)) desc limit 0,3"); $idthingy =1; while ($goldchecker = mysql_fetch_array($goldcheck)) { if ($goldchecker[id] == $playerinfo[id]) { $datastrand = ($goldchecker[level]*10000)+$goldchecker[gold]+($goldchecker[bullion]*1000000)+($goldchecker[clan_infl])+($goldchecker[battleswon]-$goldchecker[battleslost]*100)+($goldchecker[age]*10000)+$goldchecker[exp]+$goldchecker[clan_gold]+$goldchecker[clan_exp]+($goldchecker[clan_days]*10000)-$goldchecker[clan_recieve]+($goldchecker[topiccount]*5000)+($goldchecker[nectar]*10000)+($goldchecker[lucky]*100000); $status2 .= "<img src=image/cup$idthingy.gif alt='Rank $idthingy with $datastrand points'>"; } $idthingy++; } $datastrand = ($playerinfo[level]*10000)+$playerinfo[gold]+($playerinfo[bullion]*1000000)+($playerinfo[clan_infl])+($playerinfo[battleswon]-$playerinfo[battleslost]*100)+($playerinfo[age]*10000)+$playerinfo[exp]+$playerinfo[clan_gold]+$playerinfo[clan_exp]+($playerinfo[clan_days]*10000)-$playerinfo[clan_recieve]+($playerinfo[topiccount]*5000)+($playerinfo[nectar]*10000)+($playerinfo[lucky]*100000); $datastrand = number_format($datastrand); if ($playerinfo[status] == "Editor") { $status2 .= "<img src=image/mod.gif alt=Moderator>"; } if ($playerinfo[status] == "Coder") { $status2 .= "<img src=image/coder.GIF alt=Coder>"; } if ($playerinfo[status] == "admin") { $status2 .= "<img src=image/admin.gif alt=Admin>"; } if ($playerinfo[status] == "Manager"){ $status2 .= "<img src=image/manager.gif alt=Manager>"; } if ($playerinfo[status] == "Owner"){ $status2 .= "<img src=image/owner.gif alt=Owner>"; } if ($playerinfo[status] == "Operator"){ $status2 .= "<img src=image/op.gif alt=Operator>"; } if ($playerinfo[status] == "VManager" && $playerinfo[job] != "Coder"){ $status2 .= "<img src=image/vm.gif alt=Vice-Manager>"; } if ($playerinfo[status] == "Chat Monitor"){ $status2 .= "<img src=image/cm.gif alt=\"Chat Monitor\">"; } if ($playerinfo[job] == "Epaper"){ $status2 .= "<img src=image/other.gif alt=\"E-Paper Editor\">"; } if ($playerinfo[gender] == "Male"){ $status2 .= "<img src='image/gmale.gif' alt='Male'>"; } if ($playerinfo[gender] == "Female"){ $status2 .= "<img src='image/gfemale.gif' alt='Female'>"; } $datastrand = number_format($playerinfo[totalpoints]); if ($playerinfo[tprank] > 0 && $playerinfo[tprank] < 4) { $status2 .= "<img src=image/cup$playerinfo[tprank].gif alt='Rank $playerinfo[tprank] with $datastrand points'>"; } if($playerinfo[city] == "side"){$locat="Countryside";} if($playerinfo[city] == "dpal"){$locat="The Devils Kingdom";} if($playerinfo[city] == "silver"){$locat="Silver Meadows";} if($playerinfo[city] == "black"){$locat="Blackdale";} if($playerinfo[city] == "ascantha"){$locat="Ascantha";} if($playerinfo[city] == "Battlefields"){$locat="Battlefields";} if($playerinfo[city] == "world"){$locat="Hall of Worlds";} if($playerinfo[city] == "swamps"){$locat="Swamps";} if($playerinfo[city] == "caves"){$locat="Thieves Caves";} if($playerinfo[city] == "forest"){$locat="Forgotten Forest";} if($playerinfo[city] == "valley"){$locat="Mythril Valley";} if($playerinfo[city] == "melania"){$locat="Visit Melania";} if($playerinfo[city] == "cyron"){$locat="Cyron City";} if($playerinfo[city] == "desert"){$locat="Daishi Desert";} if($playerinfo[city] == "mistral"){$locat="Mistral Castle";} $tp = number_format($playerinfo[totalpoints]); $ctp = number_format($playerinfo[ctotalpoints]); $hpleft1 = $playerinfo[hp_left]; $hp_1 = $playerinfo[hp]; $hpness = round($hpleft1/$hp_1*100); $hpercentleft = 100-$hpness; $clanmine = number_format($playerinfo[attempts]); $expgot = $playerinfo[exp]; $exptolevel = $playerinfo[exp_lvl]; $expness = round($expgot/$exptolevel*100); $epercentleft = 100-$expness; sleep(2); echo "<html> <head> <title>$title</title>"; if ($style) { include("cstyle.php"); }else{ echo "<link href=image/style/style$playerinfo[style].css type=text/css rel=StyleSheet>"; } echo '</head>'; ?> <? /* if ($playerinfo[id] == 31 || $playerinfo[id] == 149 || $playerinfo[id] == 55 || $playerinfo[status] == "Manager" || $playerinfo[status] == "VManager") { echo "<center><b>You have been identified as a member of a currently proceeding DL court case, or you have been provided access. Please <a href=mb.php?action=viewboard&id=88>Click Here</a> to visit the Court MB.</b></center><br>"; } */ //echo '<font color=red>The Game will be going down soon for optimisation. The duration of this downtime is not known at this time. Thank you for your patience and co-operation.</font>'; echo '<BODY TOPMARGIN=0 LEFTMARGIN=0 bgcolor=000000> <center> <br> <table style="BORDER-RIGHT: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid;" width=100% border=0 cellspacing=0 cellpadding=0><tr><td> <td width=18% valign=top> <table class=cathead width=100% border=0 cellspacing=0 cellpadding=0> <tr><td> <img src="image/UserInfo1.gif">'; echo "<DIV id=bottommenucell> <u><b><center><a href=view.php?id=$playerinfo[id]>$playerinfo[username]</a></b></u> ($playerinfo[id])</center> <center>$status2</center><br> <b><font color=FF6600>Level:</b> $playerinfo[level]</font><br> <b><font color=FF6600>Race:</b> $playerinfo[race] [lvl $playerinfo[skill]]</font><br><br> <b><font color=00FF00>HP:</b> $hp_left/$hp [<a href=lfountain.php>H</a>] [<a href=suicide.php>S</a>]</font><br><table width=90% cellspacing=0 style=\"border-width: 1px; border-color: #C0C0C0; height: 7px; border-style: solid;\"><tr>"; if($hpness>0){ echo "<td width=$hpness% bgcolor=#006600> </td>"; } if($hpercentleft>0){ echo "<td width=$hpercentleft% bgcolor=#800000> </td>"; } echo "</tr></table><b><font color=00FF00>Exp:</b> $exps/$expneed [<a href=arena.php>F</a>]</font><br><table width=90% cellspacing=0 style=\"border-width: 1px; border-color: #C0C0C0; height: 7px; border-style: solid;\"><tr>"; if($expness>0){ echo "<td width=$expness% bgcolor=#000080> </td>"; } if($epercentleft>0){ echo "<td width=$epercentleft% bgcolor=#660066> </td>"; } $num = mysql_num_rows(mysql_query("select * from lotto")); // change this variable to new cost of lotto tickets $ticketcost = 20000; echo "</tr></table><br><b><font color=FF0000>Energy:</b> $energy<br><a href=ebank.php>Energy Bank:</a></b> $ebank<br><b>Mana:</b> $Mana</font><br><br><b><font color=00FFFF>Strength:</b> $playerinfo[strength] [<a href=gym.php>T</a>]<br><b>Agility:</b> $playerinfo[agility] [<a href=gym.php>T</a>]<br><b>Raw Defense:</b> $playerinfo[rdefense] [<a href=gym.php>T</a>]</font><br><br><b><img src=http://www.dsrpg.ca/image/cur_gold.gif width=15 height=14><font color=gold>Gold: $gold2</font><br> <b><img src=http://www.dsrpg.ca/image/cur_gold.gif width=15 height=14><font color=gold>Bank:</b> $bank</font><br><br> <b><img src=http://www.dsrpg.ca/image/cur_myth.gif width=15 height=14><font color=FF00FF>Mythril:</b> $hacks</font><br> <b><img src=http://www.dsrpg.ca/image/misc/Dskey.gif width=15 height=14><font color=yellow>Keys: $playerinfo[pkeys]</font><br><br> <b><font color=8000FF>Location:</b> <i>$locat</font></i><br><br> <center><u><font color=gold>Lotto Jackpot</u><br> ".number_format($num*0.55*$ticketcost)."</font><br> <font color=gold>[</font><a href=cas.php?action=buy>Buy Tickets</a><font color=gold>]</font></center><br> <center><u><font color=00FF00>Total Points</u><br>$tp</font></center><br>"; if ($playerinfo[clan] > 0){ echo "<center><u><font color=orange>Clan Total Points</u><br>$ctp</font></center><br>"; } /* <b>Till Reset</b>:<? $tillreset ?> <script type="text/javascript"> new showLocalTime("timecontainer", "server-ssi", 0, "short") </script> <? echo "<br><b>Time</b>: <span id=timecontainer></span> <font color=#B80505>Resets at 00:00 & 12:00<br><b>+60 Energy:</b> Hourly</font>"; ?> <script type="text/javascript"> new showLocalTime("timecontainer", "server-php", 0, "short") </script> <?*/ echo "<span id=timecontainer></span><br> </span></div>"; ?> <script type="text/javascript"> new showLocalTime("timecontainer", "server-php", 0, "short") </script> <? echo"<span class=style1> </span></div>"; echo'</tr></table> <table class=cathead width=100% border=0 cellspacing=0 cellpadding=0> <tr> <td> <img src="image/navigation1.gif"><DIV id=bottommenucell>'; $timecheck = mysql_query("Select * from usernews where user='$playerinfo[id]' order by time desc limit 0,1"); $timecheck = mysql_fetch_array($timecheck); if ($timecheck[time] > $playerinfo[lcheck]){ echo "- <a href=main.php class=new><b><font color=red>Your Cabin</b></font></a> *new*<br>"; }else{ echo "- <a href=main.php>Your Cabin</a><br>"; } // echo "- <a href=pet.php>Your Pet</a><br>"; // echo "- <a href=pbatt.php>Pet Battle</a><br>"; if($playerinfo[status] == "Owner" || $playerinfo[status] == "Manager" || $playerinfo[status] == "VManager" || $playerinfo[status] == "Coder"){echo '- <a href=admin.php>Management</a><br>';} if($playerinfo[status] == 'Coder' || $playerinfo[status] == 'Manager' || $playerinfo[status] == 'Owner') { //echo '- <a href=coder.php style="color: #ff0000">Coder Panel</a><br>'; //echo '- <a href=dbscript.php style="color: #ff0000">Database</a><br>'; } if ($playerinfo[status] == "admin"){echo'- <a href=admin.php>Admin</a><br>'; } if ($playerinfo[status] == "Editor"){echo'- <a href=editor.php>Duties</a><br>'; } if ($playerinfo[status] == "Operator"){echo'- <a href=operator.php>Operations</a><br>'; } if($playerinfo[status] != "Member"){ } if($playerinfo[city] != "black"){ echo '- <a href=inv.php>Armoury</a><br /> - <a href=imail.php>Mailbag</a><br />'; }else{ echo '- <a href=inv.php>Armoury</a><br /> - <a href=imail.php>Mailbag</a><br /> - <a href=account.php>My Account</a><br />'; if ($playerinfo[race] == "Undead") { echo '- <a href=dfountain.php>Death Fountain</a><br />'; } else { echo '- <a href=lfountain.php>Life Fountain</a><br />'; } echo'- <a href=bank.php>The Bank</font></a><br />'; echo'- <a href=ebank.php><b>Energy Bank</b></a><br />'; if ($playerinfo[vote] == 0) { echo "- <a href=vbooth.php><b>Voting Booth</b></a><br />"; } else { echo "- <a href=vbooth.php>Voting Booth</a><br />"; } } if($playerinfo[clan] > 0){ echo '- <a href=clans.php?action=myclan>Visit My Clan</a><br>'; echo '- <a href=clanx.php?action=chat>Clan Chat</a><br>'; } if($playerinfo[city] == "side"){Echo'- <a href=account.php>My Account</a><br>- <a href=quest.php>Back to Countryside</a><br>- <a href=gopt.php>Game Options</a><br>';} if($playerinfo[city] == "kingdom"){Echo'- <a href=account.php>My Account</a><br>- <a href=wklfountian.php>The Hospital</a><br>- The Gift Shop</a><br>- <a href=kingdomhall.php>Kingdom Hall</a></br>- <a href=kingdom.php>Wasted Kingdom</a><br>- <a href=wkbank.php>Kingdom Bank</a><br>- <a href=wkstone.php>Training Stone</a><br>';} if($playerinfo[city] == "melania"){Echo'- <a href=account.php>My Account</a><br>- <a href=melania.php>Visit Melania</a><br>- <a href=mb.php>Message Boards</a><br>- <a href=melfount.php>Hospital</a><br>- <a href=mmissions.php>Missions</a><br>';} if($playerinfo[city] == "silver"){Echo'- <a href=account.php>My Account</a><br>- <a href=silver.php>Visit Draconia</a><br>- <a href=wanteds.php>Greedy Market</a><br>- <a href=pshop.php>Pawn Shop</a><br>- <a href=bank.php>Draconia Bank</a><br>'; } if($playerinfo[city] == "arkham"){Echo'- <a href=account.php>My Account</a><br>- <a href=arkham.php>Visit Arkham City</a><br>- <a href=bank.php>Arkham Bank</a><br>';} if($playerinfo[city] == "black" || $playerinfo[city] == "silver" || $playerinfo[city] == "ascantha"){Echo'- <a href=arena.php>Battle Arena</a><br>';} if($playerinfo[city] == "black"){echo '- <a href=city.php>Town of Blackdale</a><br>- <a href=mb.php><font color=00FF00><b>Message Boards</b></font></a><br>- <a href=cityhall.php>Visit Town Hall</a><br>';} if($playerinfo[city] == "swamps"){Echo"- <a href=explore.php>Explore Swamps</a><br>";} if($playerinfo[city] == "caves"){Echo"- <a href=explore.php>Explore Caves</a><br>";} if($playerinfo[city] == "forest"){Echo"- <a href=explore.php>Explore Forest</a><br>";} if($playerinfo[city] == "valley"){Echo"- <a href=explore.php>Explore Valley</a><br>";} if($playerinfo[city] == "cyron"){Echo"- <a href=explore.php>Explore Cyron</a><br>";} if($playerinfo[city] == "desert"){Echo"- <a href=explore.php>Explore Desert</a><br>";} if($playerinfo[city] == "mistral"){Echo"- <a href=explore.php>Mistral Castle</a><br>";} if($playerinfo[city] == "world"){echo "- <a href=worlds.php>Hall of Worlds</a><br>";} if($playerinfo[city] == "Battlefields"){Echo'- <a href=battlefields.php>Battlefields</a><br>';} /* if($playerinfo[donated] >0 || $playerinfo[status] == "Owner" || $playerinfo[status] "Manager" || $playerinfo[status] "Coder"){ echo "- <a href=cpanel.php>Contol Panel</a><br> */ echo ' - <a href=help.php><font color=#00FF00><b>Player Help</b></font></a><br> - <a href=players.php>Players/Staff List</a><br> - <a href=donatorinfo.php>Donator Info</a><br> - <a href=ranking.php>Rankings</a><br> - <a href=donate.php>Donate</a><br> - <a href=logout.php>Logout</a><br><br>'; if($playerinfo[id] == "1" || $playerinfo[id] == "2"){ echo"<u>Owner Options</u>"; echo"<br>- <a href=wares.php>Potions Shop</a>"; } echo '</div><p></td></tr></table>'; echo'<td width=64% class=cathead valign=top><center><table cellpadding=0 width=100%><tr><td class=top-right><center>'.strtoupper($title).'</center></font></td></tr></table><table width=100% cellspacing=0 cellpadding=0><tr><td><DIV id=bottommenucell>'; ?> <html> <!---Do you like stealing Copyrighted Scripts-Fayt---> </html> Quote Link to comment https://forums.phpfreaks.com/topic/107722-db-connect/#findComment-552225 Share on other sites More sharing options...
malcome_thompson Posted May 29, 2008 Author Share Posted May 29, 2008 Anywhere in my code where is has for example hp=$playerinfo[hp], nothing shows up. Seems to me like the $playerinfo = mysql_fetch_array(mysql_query("select * from userdb where email='$email'")); is not working. Quote Link to comment https://forums.phpfreaks.com/topic/107722-db-connect/#findComment-552231 Share on other sites More sharing options...
prcollin Posted May 29, 2008 Share Posted May 29, 2008 Anywhere in my code where is has for example hp=$playerinfo[hp], nothing shows up. Seems to me like the $playerinfo = mysql_fetch_array(mysql_query("select * from userdb where email='$email'")); is not working. hey enclose the code you just put up in " " Quote Link to comment https://forums.phpfreaks.com/topic/107722-db-connect/#findComment-552232 Share on other sites More sharing options...
peranha Posted May 29, 2008 Share Posted May 29, 2008 Try this <?php $pagename = $_SERVER['REQUEST_URI']; $pagename = substr($pagename,1); $dbh=mysql_connect ("localhost", "chaotic_StaR", "stone") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("chaotic_StaR_db"); $uri = $REQUEST_URI; $playerinfo = mysql_fetch_array(mysql_query("select * from userdb where email='$email'")); mysql_query("update userdb set page='$uri' where id='$playerinfo[id]'"); if ($playerinfo[status] != "Owner" && $playerinfo[status] != "Manager" && $playerinfo[id] != "8"){ ?> <SCRIPT LANGUAGE="Javascript"><!-- // *********************************************** // AUTHOR: WWW.CGISCRIPT.NET, LLC // URL: http://www.cgiscript.net // Use the script, just leave this message intact. // Download your FREE CGI/Perl Scripts today! // ( http://www.cgiscript.net/scripts.htm ) // *********************************************** var isNS = (navigator.appName == "Netscape") ? 1 : 0; var EnableRightClick = 0; if(isNS) document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP); function mischandler(){ if(EnableRightClick==1){ return true; } else {return false; } } function mousehandler(e){ if(EnableRightClick==1){ return true; } var myevent = (isNS) ? e : event; var eventbutton = (isNS) ? myevent.which : myevent.button; if((eventbutton==2)||(eventbutton==3)) return false; } function keyhandler(e) { var myevent = (isNS) ? e : window.event; if (myevent.keyCode==96) EnableRightClick = 1; return; } document.oncontextmenu = mischandler; document.onkeypress = keyhandler; document.onmousedown = mousehandler; document.onmouseup = mousehandler; //--> </script> <script language="JavaScript"><!-- //script by Clarence Eldefors http://www.cerebuswebmaster.com var speed = 20; var step = 5; var hide = 10000; var moveto = 500; // Do not edit below this line var left = 0; function movein(){ if (document.layers) { document.layers['message'].pageX = window.pageXOffset + left; left+=step; if(left<moveto){ setTimeout('movein()',speed); } else { setTimeout('closemessage()',hide); } } else{ document.getElementById('message').style.left=left+'px'; left+=step; if(left<moveto){ setTimeout('movein()',speed); } else { setTimeout('closemessage()',hide); } } } function closemessage(){ if (document.layers) {document.layers['message'].visibility='hidden';} else{document.getElementById('message').style.visibility='hidden';} } //--></script> <style type="text/css" media="screen"><!-- #message {top:200px; border:1px solid black; width:200px;background-color:red;padding:4px; position:absolute;} --> </style> <?php } ?> And this is the other: <?php $time_start = microtime(true); $ip = $REMOTE_ADDR; include("dateinfo.php"); include("patch.php"); require("privates/thedb2.php"); ?> <script type="text/javascript"> /*********************************************** * Local Time script- © Dynamic Drive (http://www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit http://www.dynamicdrive.com/ for this script and 100s more. ***********************************************/ //CHANGE SERVER RESULT TO TEXT var weekdaystxt=["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] var daystxt=["31st", "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th", "21st", "22nd", "23rd", "24th", "25th", "26th", "27th", "28th", "29th", "30th"] var monthtxt=["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] function showLocalTime(container, servermode, offsetMinutes, displayversion){ if (!document.getElementById || !document.getElementById(container)) return this.container=document.getElementById(container) this.displayversion=displayversion var servertimestring=(servermode=="server-php")? '<?php print date("F d, Y H:i:s", time())?>' : (servermode=="server-ssi")? '<!--#config timefmt="%B %d, %Y %H:%M:%S"-->' : '<%= Now() %>' this.localtime=this.serverdate=new Date(servertimestring) this.localtime.setTime(this.serverdate.getTime()+offsetMinutes*60*1000) //add user offset to server time this.updateTime() this.updateContainer()} showLocalTime.prototype.updateTime=function(){ var thisobj=this this.localtime.setSeconds(this.localtime.getSeconds()+1) setTimeout(function(){thisobj.updateTime()}, 1000)} //update time every second showLocalTime.prototype.updateContainer=function(){ var thisobj=this if (this.displayversion=="long") this.container.innerHTML=this.localtime.toLocaleString() else{ var hour=this.localtime.getHours() var minutes=this.localtime.getMinutes() var seconds=this.localtime.getSeconds() //FOR WHEN SEC/MIN/HR OVER I.E DAILY RESET if (seconds < 1){ var resets=00 var resetm=(59-minutes)+1 var reseth=23-hour if (resetm > 59){ var resetm=00 var reseth=(23-hour)+1}} //IF NO VALUE IS '00' else{ var reseth=23-hour var resetm=59-minutes var resets=60-seconds} //***ADD THE AM/PM PART IF ON 12HR SETTING--- ALSO ADD "+ampm+" INTO DISPLAY LINE BELOW //var ampm=(hour>=12)? "PM" : "AM" //GET SERVER FIGURE AND FILTER THROUGH LISTS AT START var dayofweek=weekdaystxt[this.serverdate.getDay()] var day=daystxt[this.serverdate.getDate()] var month=monthtxt[this.serverdate.getMonth()] var year=[this.serverdate.getFullYear()] this.container.innerHTML="<font color=FF0000>Game Time:</font> "+formatField(hour, 1)+":"+formatField(minutes)+":"+formatField(seconds)+" <font color=FF0000>Main Reset In:</font> "+formatField(reseth, 1)+":"+formatField(resetm)+":"+formatField(resets)} setTimeout(function(){thisobj.updateContainer()}, 1000)} //update container every second function formatField(num, isHour){ //SWITCH TO 12/24HR STYLE //if (typeof isHour!="undefined"){ //var hour=(num>12)? num-12 : num //return (hour==0)? 12 : hour} //END SWITCH TO 12/24HR return (num<=9)? "0"+num : num} //if this is minute or sec field </script> <?php $totalpoints =(($playerinfo[level]*1000)+$playerinfo[gold]+$playerinfo[bank]+$playerinfo[clan_infl]+($playerinfo[battleswon]-$playerinfo[battleslost]*100)+($playerinfo[age]*10000)+$playerinfo[exp]+$playerinfo[clan_gold]+$playerinfo[clan_exp]+($playerinfo[clan_days]*10000)-$playerinfo[clan_recieve]+($playerinfo[topiccount]*5000)+($playerinfo[nectar]*10000)+($playerinfo[lucky]*100000)); mysql_query("update userdb set totalpoints='$totalpoints' where id='$playerinfo[id]'"); $ctotalpoints = ($playerinfo[crystals]*5)+($playerinfo[lcrystal]*10)+($playerinfo[scrystal]*20)+($playerinfo[mcrystal]*30); mysql_query("update userdb set ctotalpoints='$ctotalpoints' where id='$playerinfo[id]'"); $email = $_SESSION['email']; $password = $_SESSION['password']; /* if(stristr($HTTP_USER_AGENT,'mediapartners-google')) { $email = 'googlebotian'; $password = 'googleification'; if ($data > $loadcap/2) { sleep(50); } } */ if (!$playerfields) { $playerfields = '*'; }elseif($playerfields == 'none'){ $playerfields = 'password,male,female,verified,jailtime,jail_by,jail_reason,email,age,chatban,cbanreason,username,id,donated,rank,exp,exp_lvl,gold,bank,hacks,nectar,hp_left,hp,status,job,totalpoints,tprank,city,style,level,race,skill,attempts,faith,muse,energy,Mana,mine_att,strength,agility,rdefense,lcheck,vote,clan,chat,vote1,vote2,vote3,vote4,vote5,vote6,vote7,vote8,vote9,vote10,vote11,vote12,vote13'; }elseif($playerfields != 'none'){ $playerfields .= 'password,male,female,verified,jailtime,jail_by,jail_reason,email,age,chatban,cbanreason,username,id,donated,rank,exp,exp_lvl,gold,bank,hacks,nectar,hp_left,hp,status,job,totalpoints,tprank,city,style,level,race,skill,attempts,faith,muse,energy,Mana,mine_att,strength,agility,rdefense,lcheck,vote,clan,chat,vote1,vote2,vote3,vote4,vote5,vote6,vote7,vote8,vote9,vote10,vote11,vote12,vote13'; } $downreason = ''; $playerinfo = mysql_fetch_array(mysql_query("SELECT * FROM userdb WHERE email = '$email'")); if($playerinfo[status] == "Manager" || $playerinfo[status] == "VManager" && $playerinfo[job] == "Coder"){ $downreason = ''; } if ($downreason) { echo "<link href=styles/style1.css type=text/css rel=StyleSheet><center> </center><font color=red>Game Frozen The game is down while $downreason. Please wait patiently.</font>"; exit; } if ($playerinfo[donated] < 20) { while ($data > $loadcap) { $reps++; sleep(1); $data = serverload(); if ($reps == 4) break; } } if(!$email || !$password){ echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center> </center><font color=red>Error Code 1 Your session has timed out. Please <a href=index.php>relogin[/url].</font>'; exit; } if($playerinfo[password] != $password){ echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center> </center><font color=red>Error Code 2 Incorrect email or password. Please <a href=index.php>relogin[/url].</font>'; exit; } if($playerinfo[verified] != "Y"){ echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center> </center><font color=red>Error Code 3 Verification required. Please <a href=verify.php>verify[/url] here.</font>'; exit; } if($playerinfo[jailtime] > 0){ echo "<link href=styles/style1.css type=text/css rel=StyleSheet><center> </center><body text=#800000 bgcolor=#000000></body><font face=Arial><font color=red>Error Code 4 You are in jail for another $playerinfo[jailtime] days.<p>Jailed by: $playerinfo[jail_by] for reason: $playerinfo[jail_reason]"; exit; } $ipbancheck = mysql_num_rows(mysql_query("select * from bannedip where ipaddress='$ip'")); if($ipbancheck > 0){ echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center> </center><font color=red>Error Code 5 Your IP is banned. To have this ban reviewed please <a href=index.php?action=support>Contact Support[/url].</font>'; exit; } if (($HTTP_X_FORWARDED_FOR == "67.171.23.92" || $REMOTE_ADDR == "67.171.23.92" || $HTTP_X_FORWARDED_FOR == "66.235.203.202" || $REMOTE_ADDR == "66.235.203.202") && $playerinfo != '[email]zereth@comcast.net') { echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center> </center><font color=red>Error Code 5 Your account is under the effect of a custom ban. To have this ban reviewed please <a href=index.php?action=support>Contact Support[/url].</font>'; exit; } $emailbancheck = mysql_num_rows(mysql_query("select email from bannedip where email='$email'")); if($emailbancheck > 0){ echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center> </center><font color=red>Error Code 6 Your email address is banned. To have this ban reviewed please <a href=index.php?action=support>Contact Support[/url].</font>'; exit; } //if($playerinfo[id]> 3){ // echo '<link href=styles/style1.css type=text/css rel=StyleSheet><center> </center><font color=red>Error Code 7 Game is currently down while we move server, thanks.</font>'; // // exit; // // } if ($playerinfo[chatban] > 0 && $title == "Chat"){ echo "You are banned from chat for $playerinfo[chatban] days for $playerinfo[cbanreason]."; exit; } if (eregi('sqrpg',$playerinfo[username])) { mysql_query("update userdb set username='No Advertising' where id='$playerinfo[id]'"); } if (eregi('www.',$playerinfo[username])) { mysql_query("update userdb set username='No Advertising' where id='$playerinfo[id]'"); } if (eregi('.com',$playerinfo[username])) { mysql_query("update userdb set username='No Advertising' where id='$playerinfo[id]'"); } if (eregi('.c0m',$playerinfo[username])) { mysql_query("update userdb set username='No Advertising' where id='$playerinfo[id]'"); } if (eregi('. c o m',$playerinfo[username])) { mysql_query("update userdb set username='No Advertising' where id='$playerinfo[id]'"); } if (eregi('<',$playerinfo[username])) { mysql_query("update userdb set username='No HTML' where id='$playerinfo[id]'"); } if (eregi('>',$playerinfo[username])) { mysql_query("update userdb set username='No HTML' where id='$playerinfo[id]'"); } if ($playerinfo[id] == "1") { mysql_query("update userdb set username='The Wasted 1' where id='1'"); mysql_query("update userdb set status='Owner' where id='1'"); } if (!$dest) { mysql_query("update fishdb set outonboat='N' where owner='$playerinfo[id]'"); } mysql_query("update userdb set active='$time', active2='$realtime', ipaddress='$ip', clickstoday=clickstoday+1 where email='$email'"); mysql_query("update userdb set inactive='0' where id='$playerinfo[id]'"); $rankname = array( "Peasant", "Valet", "Squire", "Knight", "Lord", "Dol", "Earl", "Count", "Thane", "Duke", "Archduke", "Royal"); $rankypanky = $playerinfo[rank]; $merank = $rankname[$rankypanky]; $exps = number_format($playerinfo[exp]); $expneed = number_format($playerinfo[exp_lvl]); $gold2 = number_format($playerinfo[gold]); $bank = number_format($playerinfo[bank]); $hacks = number_format($playerinfo[hacks]); $nectar = number_format($playerinfo[nectar]); $hp_left = number_format($playerinfo[hp_left]); $hp = number_format($playerinfo[hp]); $energy = number_format($playerinfo[energy]); $ebank = number_format($playerinfo[ebank]); $Mana = number_format($playerinfo[Mana]); $mineatt = number_format($playerinfo[mine_att]); $faith = number_format($playerinfo[faith]); if ($playerinfo[hp_left] == 0) { $status2 = "<img src=image/Misc/Skull.gif alt=Dead>"; } if ($playerinfo[donated] > 0) { $status2 .= "<img src=image/donator$playerinfo[donated].gif alt=\"Noble $merank ($playerinfo[donated])\">"; } //ranks $goldcheck = Mysql_query("select * from userdb order by ((level*10000)+gold+(bullion*1000000)+clan_infl+(battleswon-battleslost*100)+(age*10000)+exp+clan_gold+clan_exp+(clan_days*10000)-clan_recieve+(topiccount*5000)+(nectar*10000)+(lucky*100000)) desc limit 0,3"); $idthingy =1; while ($goldchecker = mysql_fetch_array($goldcheck)) { if ($goldchecker[id] == $playerinfo[id]) { $datastrand = ($goldchecker[level]*10000)+$goldchecker[gold]+($goldchecker[bullion]*1000000)+($goldchecker[clan_infl])+($goldchecker[battleswon]-$goldchecker[battleslost]*100)+($goldchecker[age]*10000)+$goldchecker[exp]+$goldchecker[clan_gold]+$goldchecker[clan_exp]+($goldchecker[clan_days]*10000)-$goldchecker[clan_recieve]+($goldchecker[topiccount]*5000)+($goldchecker[nectar]*10000)+($goldchecker[lucky]*100000); $status2 .= "<img src=image/cup$idthingy.gif alt='Rank $idthingy with $datastrand points'>"; } $idthingy++; } $datastrand = ($playerinfo[level]*10000)+$playerinfo[gold]+($playerinfo[bullion]*1000000)+($playerinfo[clan_infl])+($playerinfo[battleswon]-$playerinfo[battleslost]*100)+($playerinfo[age]*10000)+$playerinfo[exp]+$playerinfo[clan_gold]+$playerinfo[clan_exp]+($playerinfo[clan_days]*10000)-$playerinfo[clan_recieve]+($playerinfo[topiccount]*5000)+($playerinfo[nectar]*10000)+($playerinfo[lucky]*100000); $datastrand = number_format($datastrand); if ($playerinfo[status] == "Editor") { $status2 .= "<img src=image/mod.gif alt=Moderator>"; } if ($playerinfo[status] == "Coder") { $status2 .= "<img src=image/coder.GIF alt=Coder>"; } if ($playerinfo[status] == "admin") { $status2 .= "<img src=image/admin.gif alt=Admin>"; } if ($playerinfo[status] == "Manager"){ $status2 .= "<img src=image/manager.gif alt=Manager>"; } if ($playerinfo[status] == "Owner"){ $status2 .= "<img src=image/owner.gif alt=Owner>"; } if ($playerinfo[status] == "Operator"){ $status2 .= "<img src=image/op.gif alt=Operator>"; } if ($playerinfo[status] == "VManager" && $playerinfo[job] != "Coder"){ $status2 .= "<img src=image/vm.gif alt=Vice-Manager>"; } if ($playerinfo[status] == "Chat Monitor"){ $status2 .= "<img src=image/cm.gif alt=\"Chat Monitor\">"; } if ($playerinfo[job] == "Epaper"){ $status2 .= "<img src=image/other.gif alt=\"E-Paper Editor\">"; } if ($playerinfo[gender] == "Male"){ $status2 .= "<img src='image/gmale.gif' alt='Male'>"; } if ($playerinfo[gender] == "Female"){ $status2 .= "<img src='image/gfemale.gif' alt='Female'>"; } $datastrand = number_format($playerinfo[totalpoints]); if ($playerinfo[tprank] > 0 && $playerinfo[tprank] < 4) { $status2 .= "<img src=image/cup$playerinfo[tprank].gif alt='Rank $playerinfo[tprank] with $datastrand points'>"; } if($playerinfo[city] == "side"){$locat="Countryside";} if($playerinfo[city] == "dpal"){$locat="The Devils Kingdom";} if($playerinfo[city] == "silver"){$locat="Silver Meadows";} if($playerinfo[city] == "black"){$locat="Blackdale";} if($playerinfo[city] == "ascantha"){$locat="Ascantha";} if($playerinfo[city] == "Battlefields"){$locat="Battlefields";} if($playerinfo[city] == "world"){$locat="Hall of Worlds";} if($playerinfo[city] == "swamps"){$locat="Swamps";} if($playerinfo[city] == "caves"){$locat="Thieves Caves";} if($playerinfo[city] == "forest"){$locat="Forgotten Forest";} if($playerinfo[city] == "valley"){$locat="Mythril Valley";} if($playerinfo[city] == "melania"){$locat="Visit Melania";} if($playerinfo[city] == "cyron"){$locat="Cyron City";} if($playerinfo[city] == "desert"){$locat="Daishi Desert";} if($playerinfo[city] == "mistral"){$locat="Mistral Castle";} $tp = number_format($playerinfo[totalpoints]); $ctp = number_format($playerinfo[ctotalpoints]); $hpleft1 = $playerinfo[hp_left]; $hp_1 = $playerinfo[hp]; $hpness = round($hpleft1/$hp_1*100); $hpercentleft = 100-$hpness; $clanmine = number_format($playerinfo[attempts]); $expgot = $playerinfo[exp]; $exptolevel = $playerinfo[exp_lvl]; $expness = round($expgot/$exptolevel*100); $epercentleft = 100-$expness; sleep(2); echo "<html> <head> <title>$title</title>"; if ($style) { include("cstyle.php"); }else{ echo "<link href=image/style/style$playerinfo[style].css type=text/css rel=StyleSheet>"; } echo '</head>'; ?> <?php /* if ($playerinfo[id] == 31 || $playerinfo[id] == 149 || $playerinfo[id] == 55 || $playerinfo[status] == "Manager" || $playerinfo[status] == "VManager") { echo "<center>You have been identified as a member of a currently proceeding DL court case, or you have been provided access. Please <a href=mb.php?action=viewboard&id=88>Click Here[/url] to visit the Court MB.</center> "; } */ //echo '<font color=red>The Game will be going down soon for optimisation. The duration of this downtime is not known at this time. Thank you for your patience and co-operation.</font>'; echo '<BODY TOPMARGIN=0 LEFTMARGIN=0 bgcolor=000000> <center> <table style="BORDER-RIGHT: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid;" width=100% border=0 cellspacing=0 cellpadding=0><tr><td> <td width=18% valign=top> <table class=cathead width=100% border=0 cellspacing=0 cellpadding=0> <tr><td> <img src="image/UserInfo1.gif">'; echo "<DIV id=bottommenucell> <center><a href=view.php?id=$playerinfo[id]>$playerinfo[username][/url] ($playerinfo[id])</center> <center>$status2</center> <font color=FF6600>Level: $playerinfo[level]</font> <font color=FF6600>Race: $playerinfo[race] [lvl $playerinfo[skill]]</font> <font color=00FF00>HP: $hp_left/$hp [<a href=lfountain.php>H[/url]] [<a href=suicide.php>S[/url]]</font> <table width=90% cellspacing=0 style=\"border-width: 1px; border-color: #C0C0C0; height: 7px; border-style: solid;\"><tr>"; if($hpness>0){ echo "<td width=$hpness% bgcolor=#006600> </td>"; } if($hpercentleft>0){ echo "<td width=$hpercentleft% bgcolor=#800000> </td>"; } echo "</tr></table><font color=00FF00>Exp: $exps/$expneed [<a href=arena.php>F[/url]]</font> <table width=90% cellspacing=0 style=\"border-width: 1px; border-color: #C0C0C0; height: 7px; border-style: solid;\"><tr>"; if($expness>0){ echo "<td width=$expness% bgcolor=#000080> </td>"; } if($epercentleft>0){ echo "<td width=$epercentleft% bgcolor=#660066> </td>"; } $num = mysql_num_rows(mysql_query("select * from lotto")); // change this variable to new cost of lotto tickets $ticketcost = 20000; echo "</tr></table> <font color=FF0000>Energy: $energy <a href=ebank.php>Energy Bank:[/url] $ebank Mana: $Mana</font> <font color=00FFFF>Strength: $playerinfo[strength] [<a href=gym.php>T[/url]] Agility: $playerinfo[agility] [<a href=gym.php>T[/url]] Raw Defense: $playerinfo[rdefense] [<a href=gym.php>T[/url]]</font> <font color=gold>Gold: $gold2</font> <font color=gold>Bank: $bank</font> <font color=FF00FF>Mythril: $hacks</font> <font color=yellow>Keys: $playerinfo[pkeys]</font> <font color=8000FF>Location: $locat</font> <center><font color=gold>Lotto Jackpot ".number_format($num*0.55*$ticketcost)."</font> <font color=gold>[</font><a href=cas.php?action=buy>Buy Tickets[/url]<font color=gold>]</font></center> <center><font color=00FF00>Total Points $tp</font></center> "; if ($playerinfo[clan] > 0){ echo "<center><font color=orange>Clan Total Points $ctp</font></center> "; } /* Till Reset:<?php $tillreset ?> <script type="text/javascript"> new showLocalTime("timecontainer", "server-ssi", 0, "short") </script> <?php echo " Time: <span id=timecontainer></span> <font color=#B80505>Resets at 00:00 & 12:00 +60 Energy: Hourly</font>"; ?> <script type="text/javascript"> new showLocalTime("timecontainer", "server-php", 0, "short") </script> <?php*/ echo "<span id=timecontainer></span> </span></div>"; ?> <script type="text/javascript"> new showLocalTime("timecontainer", "server-php", 0, "short") </script> <?php echo"<span class=style1> </span></div>"; echo'</tr></table> <table class=cathead width=100% border=0 cellspacing=0 cellpadding=0> <tr> <td> <img src="image/navigation1.gif"><DIV id=bottommenucell>'; $timecheck = mysql_query("Select * from usernews where user='$playerinfo[id]' order by time desc limit 0,1"); $timecheck = mysql_fetch_array($timecheck); if ($timecheck[time] > $playerinfo[lcheck]){ echo "- <a href=main.php class=new><font color=red>Your Cabin</font>[/url] *new* "; }else{ echo "- <a href=main.php>Your Cabin[/url] "; } echo "- <a href=pet.php>Your Pet[/url] "; echo "- <a href=pbatt.php>Pet Battle[/url] "; if($playerinfo[status] == "Owner" || $playerinfo[status] == "Manager" || $playerinfo[status] == "VManager" || $playerinfo[status] == "Coder"){echo '- <a href=admin.php>Management[/url] ';} if($playerinfo[status] == 'Coder' || $playerinfo[status] == 'Manager' || $playerinfo[status] == 'Owner') { echo '- <a href=coder.php style="color: #ff0000">Coder Panel[/url] '; echo '- <a href=dbscript.php style="color: #ff0000">Database[/url] '; } if ($playerinfo[status] == "admin"){echo'- <a href=admin.php>Admin[/url] '; } if ($playerinfo[status] == "Editor"){echo'- <a href=editor.php>Duties[/url] '; } if ($playerinfo[status] == "Operator"){echo'- <a href=operator.php>Operations[/url] '; } if($playerinfo[status] != "Member"){ } if($playerinfo[city] != "black"){ echo '- <a href=inv.php>Armoury[/url] - <a href=imail.php>Mailbag[/url] '; }else{ echo '- <a href=inv.php>Armoury[/url] - <a href=imail.php>Mailbag[/url] - <a href=account.php>My Account[/url] '; if ($playerinfo[race] == "Undead") { echo '- <a href=dfountain.php>Death Fountain[/url] '; } else { echo '- <a href=lfountain.php>Life Fountain[/url] '; } echo'- <a href=bank.php>The Bank</font>[/url] '; echo'- <a href=ebank.php>Energy Bank[/url] '; if ($playerinfo[vote] == 0) { echo "- <a href=vbooth.php>Voting Booth[/url] "; } else { echo "- <a href=vbooth.php>Voting Booth[/url] "; } } if($playerinfo[clan] > 0){ echo '- <a href=clans.php?action=myclan>Visit My Clan[/url] '; echo '- <a href=clanx.php?action=chat>Clan Chat[/url] '; } if($playerinfo[city] == "side"){Echo'- <a href=account.php>My Account[/url] - <a href=quest.php>Back to Countryside[/url] - <a href=gopt.php>Game Options[/url] ';} if($playerinfo[city] == "kingdom"){Echo'- <a href=account.php>My Account[/url] - <a href=wklfountian.php>The Hospital[/url] - The Gift Shop[/url] - <a href=kingdomhall.php>Kingdom Hall[/url]</br>- <a href=kingdom.php>Wasted Kingdom[/url] - <a href=wkbank.php>Kingdom Bank[/url] - <a href=wkstone.php>Training Stone[/url] ';} if($playerinfo[city] == "melania"){Echo'- <a href=account.php>My Account[/url] - <a href=melania.php>Visit Melania[/url] - <a href=mb.php>Message Boards[/url] - <a href=melfount.php>Hospital[/url] - <a href=mmissions.php>Missions[/url] ';} if($playerinfo[city] == "silver"){Echo'- <a href=account.php>My Account[/url] - <a href=silver.php>Visit Draconia[/url] - <a href=wanteds.php>Greedy Market[/url] - <a href=pshop.php>Pawn Shop[/url] - <a href=bank.php>Draconia Bank[/url] '; } if($playerinfo[city] == "arkham"){Echo'- <a href=account.php>My Account[/url] - <a href=arkham.php>Visit Arkham City[/url] - <a href=bank.php>Arkham Bank[/url] ';} if($playerinfo[city] == "black" || $playerinfo[city] == "silver" || $playerinfo[city] == "ascantha"){Echo'- <a href=arena.php>Battle Arena[/url] ';} if($playerinfo[city] == "black"){echo '- <a href=city.php>Town of Blackdale[/url] - <a href=mb.php><font color=00FF00>Message Boards</font>[/url] - <a href=cityhall.php>Visit Town Hall[/url] ';} if($playerinfo[city] == "swamps"){Echo"- <a href=explore.php>Explore Swamps[/url] ";} if($playerinfo[city] == "caves"){Echo"- <a href=explore.php>Explore Caves[/url] ";} if($playerinfo[city] == "forest"){Echo"- <a href=explore.php>Explore Forest[/url] ";} if($playerinfo[city] == "valley"){Echo"- <a href=explore.php>Explore Valley[/url] ";} if($playerinfo[city] == "cyron"){Echo"- <a href=explore.php>Explore Cyron[/url] ";} if($playerinfo[city] == "desert"){Echo"- <a href=explore.php>Explore Desert[/url] ";} if($playerinfo[city] == "mistral"){Echo"- <a href=explore.php>Mistral Castle[/url] ";} if($playerinfo[city] == "world"){echo "- <a href=worlds.php>Hall of Worlds[/url] ";} if($playerinfo[city] == "Battlefields"){Echo'- <a href=battlefields.php>Battlefields[/url] ';} /* if($playerinfo[donated] >0 || $playerinfo[status] == "Owner" || $playerinfo[status] "Manager" || $playerinfo[status] "Coder"){ echo "- <a href=cpanel.php>Contol Panel[/url] */ echo ' - <a href=help.php><font color=#00FF00>Player Help</font>[/url] - <a href=players.php>Players/Staff List[/url] - <a href=donatorinfo.php>Donator Info[/url] - <a href=ranking.php>Rankings[/url] - <a href=donate.php>Donate[/url] - <a href=logout.php>Logout[/url] '; if($playerinfo[id] == "1" || $playerinfo[id] == "2"){ echo"Owner Options"; echo" - <a href=wares.php>Potions Shop[/url]"; } echo '</div><p></td></tr></table>'; echo'<td width=64% class=cathead valign=top><center><table cellpadding=0 width=100%><tr><td class=top-right><center>'.strtoupper($title).'</center></font></td></tr></table><table width=100% cellspacing=0 cellpadding=0><tr><td><DIV id=bottommenucell>'; ?> <html> <!---Do you like stealing Copyrighted Scripts-Fayt---> </html> There was some lines that were commented out that shouldnt have been Quote Link to comment https://forums.phpfreaks.com/topic/107722-db-connect/#findComment-552234 Share on other sites More sharing options...
peranha Posted May 29, 2008 Share Posted May 29, 2008 Also all of these $playerinfo[hp] should be $playerinfo['hp'] with the ' Quote Link to comment https://forums.phpfreaks.com/topic/107722-db-connect/#findComment-552235 Share on other sites More sharing options...
.josh Posted May 29, 2008 Share Posted May 29, 2008 For the love of God, use code/php tags. Also, I smell 3rd party script. I'm moving it to the 3rd party scripts forums, though I suggest you go to the script's support forum or contact the script writer, as you'll probably have a lot better luck doing that. Quote Link to comment https://forums.phpfreaks.com/topic/107722-db-connect/#findComment-552237 Share on other sites More sharing options...
malcome_thompson Posted May 29, 2008 Author Share Posted May 29, 2008 I tried putting in the ' in all the boxes, ie ['hp'], but it just loaded up a white screen Quote Link to comment https://forums.phpfreaks.com/topic/107722-db-connect/#findComment-552240 Share on other sites More sharing options...
malcome_thompson Posted May 29, 2008 Author Share Posted May 29, 2008 I tried using that script you suggested, now it tells me my password is wrong, even though it is right. Quote Link to comment https://forums.phpfreaks.com/topic/107722-db-connect/#findComment-552242 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.