KaineBennett Posted June 4, 2014 Posted June 4, 2014 (edited) I got the base script off a friend who made it but the game is still bugged, I have got a few bugs out of the script but there is one what I cannot find... It says these two errors on different pages... Fatal error: Cannot redeclare class System in /usr/share/php/System.php on line 59 <--- this is my DB files so there is no line 59 in there. Warning: mysql_query(): Access denied for user ''@'*********' (using password: NO) in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 12 Warning: mysql_query(): A link to the server could not be established in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 12 Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 14 Warning: mysql_query(): Access denied for user ''@'*********' (using password: NO) in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 15 Warning: mysql_query(): A link to the server could not be established in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 15 Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 17 Warning: mysql_query(): Access denied for user ''@'*********' (using password: NO) in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 28 Warning: mysql_query(): A link to the server could not be established in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 28 Warning: mysql_query(): Access denied for user ''@'*********' (using password: NO) in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 35 Warning: mysql_query(): A link to the server could not be established in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 35 Warning: mysql_query(): Access denied for user ''@'*********' (using password: NO) in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 36 Warning: mysql_query(): A link to the server could not be established in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 36 Warning: mysql_query(): Access denied for user ''@'*********' (using password: NO) in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 71 Warning: mysql_query(): A link to the server could not be established in /customers/a/9/9/*********.co.uk/httpd.www/Includes/Server.php on line 71 Access denied for user ''@'*********' (using password: NO) And this is server.php <?php session_start(); include_once "System.php"; $time=time() - 1; $sm="$username"; $username=$_SESSION['username']; echo "<link rel=stylesheet href=../Style/style.css type=text/css>"; $query=mysql_query("SELECT * FROM users WHERE username='$username' LIMIT 1"); $info = mysql_fetch_object($query); $carloan1 = mysql_query("SELECT * FROM car_loan"); $carloan = mysql_fetch_object($carloan1); $date = gmdate('Y-m-d h:i:s'); if ($info->health <= "0"){ mysql_query("UPDATE users SET status='Dead' WHERE username='$username'"); session_destroy(); } if ($carloan->length <= "$time"){ mysql_query("UPDATE garage SET owner='$carloan->by' WHERE id='$carloan->reason'"); mysql_query("DELETE from carloan WHERE reason='$carloan->reason'"); } if ($info->status == "Banned"){ session_destroy(); echo "<link href='style3.css' rel='stylesheet' type='text/css'> <form name='form1' method='post' action=''> <table width='350' border='1' align='center' class='tableborder2'> <tr align='center' class=''> <td background='Images/Grads/Error.jpg'>Error</td> </tr> <tr align='center'> <td>Sorry But Your Been Banned<br /> <img src='http://.co.uk/Improved/Includes/nono.gif' /><br /> If You Dont Think You Got Banned For A Good Reason Speak To A Member Off Staff!!</td> </tr> </table> </form>"; exit(); } if ($carloan->status == "0" || $carloan->length == time()){ mysql_query("UPDATE garage SET owner='$carloan->by' WHERE id='$carloan->reason'"); mysql_query("DELETE from carloan WHERE reason='$carloan->reason'"); exit(); } $check123 = mysql_query("SELECT * FROM repair ORDER BY id ASC") or die(mysql_error()); $now = date('U'); $time = gmdate('h:i:s'); $username = $_SESSION['username']; while($check23 = mysql_fetch_array($check123)) { if($check23['time_left'] <= time()) { $extra = ""; mysql_query("UPDATE garage SET owner = '$check23[owner]' WHERE id = '$check23[car_id]' LIMIT 1"); mysql_query("UPDATE users SET carid = '' WHERE carid = '$check23[car_id]' LIMIT 1"); mysql_query("DELETE FROM repair WHERE id = '$check23[car_id]'"); $message = "Your car has been repaired and returned to your garage with 0% damage.<br>Car ID: $check23[car_id]"; $inbox = mysql_query("INSERT INTO `inbox` (`to`,`from`,`sub`,`title`,`message`,`date`,`read`) VALUES ('$check23[from]', 'System', 'Mechanics', 'Mechanics', '$message', '$date', '0')") or die (mysql_error()); mysql_query("UPDATE garage SET damage='0' WHERE id='$check23[car_id]' LIMIT 1"); } } $bba=mysql_query("SELECT * FROM bank"); while($nana =mysql_fetch_object($bba)){ $ppl=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$nana->owner'")); if ($ppl->status == "Banned"){ mysql_query("UPDATE bank SET owner='0' WHERE id='$nana->id'"); } } function logincheck(){ if (empty($_SESSION['username'])){ echo " <SCRIPT LANGUAGE='JavaScript'> window.location='index.php'; </script> "; exit(); }} ////UPDATE ONLINE $time = time() + (1 * 10); mysql_query("UPDATE users SET online='$time' WHERE username='$username'"); ///FINSH UPDATING ONLINE { if(strlen($input)<=3) { return $input; } $length=substr($input,0,strlen($input)-3); $formatted_input = makecomma($length).",".substr($input,-3); return $formatted_input; } /////////NOW TO THE BB CODES ETC.... function rankcheck(){ $username=$_SESSION['username']; $query=mysql_query("SELECT * FROM users WHERE username='$username' LIMIT 1"); $info = mysql_fetch_object($query); $date = gmdate('Y-m-d h:i:s'); if (($info->rank == "Scum") && ($info->rankpoints >= "100")){ $newrank="Wannabe"; $done="1"; } elseif (($info->rank == "Wannabe") && ($info->rankpoints >= "200")){ $newrank="Thug"; $done="1"; } elseif (($info->rank == "Thug") && ($info->rankpoints >= "400")){ $newrank="Robber"; $done="1"; } elseif (($info->rank == "Robber") && ($info->rankpoints >= "800")){ $newrank="Gangster"; $done="1"; } elseif (($info->rank == "Gangster") && ($info->rankpoints >= "1600")){ $newrank="Criminal"; $done="1"; } elseif (($info->rank == "Criminal") && ($info->rankpoints >= "3200")){ $newrank="Wanted Criminal"; $done="1"; } elseif (($info->rank == "Wanted Criminal") && ($info->rankpoints >= "6400")){ $newrank="Hitman"; $done="1"; } elseif (($info->rank == "Hitman") && ($info->rankpoints >= "12800")){ $newrank="Loyal Hitman"; $done="1"; } elseif (($info->rank == "Loyal Hitman") && ($info->rankpoints >= "25600")){ $newrank="Boss"; $done="1"; } elseif (($info->rank == "Boss") && ($info->rankpoints >= "51200")){ $newrank="Loyal Boss"; $done="1"; } elseif (($info->rank == "Loyal Boss") && ($info->rankpoints >= "102400")){ $newrank="Godfather"; $done="1"; } elseif (($info->rank == "Godfather") && ($info->rankpoints >= "200000")){ $newrank="Don"; $done="1"; } elseif (($info->rank == "Don") && ($info->rankpoints >= "400000")){ $newrank="Legend"; $done="1"; } elseif (($info->rank == "Legend") && ($info->rankpoints >= "800000")){ $newrank="Legendary Legend"; $done="1"; } if (!$done){ $done="0"; } if ($done == "1"){ mysql_query("UPDATE users SET rank='$newrank' WHERE username='$username'"); mysql_query("INSERT INTO `inbox` ( `id` , `to` , `from` , `message` , `date` , `read` , `saved` , `event_id` ) VALUES ( '', '$username', '$username', 'You have been promoted to $newrank your doing well!', '$date', '0', '0', '0' )"); }} rankcheck(); ///////HOUSTON WE HAVE JAIL CHECK! $jail_check=mysql_query("SELECT * FROM jail"); while($monster=mysql_fetch_object($jail_check)){ if (time() > $monster->time_left){ mysql_query("DELETE FROM jail WHERE username='$monster->username'"); }} function maketime($last){ $timenow = time(); if($last>$timenow){ $order = $last-$timenow; while($order >= 60){ $order = $order-60; $ordermleft++; } while($ordermleft >= 60){ $ordermleft = $ordermleft-60; $orderhleft++; } if($ordermleft == 0){ $ordermleft = ""; } else { $ordermleft = "$ordermleft Minutes"; } if($orderhleft == 0){ $orderhleft = ""; } else { $orderhleft = "$orderhleft Hours"; } return "$orderhleft $ordermleft $order Seconds"; }} $bank =mysql_query("SELECT * FROM bank"); while($fetch_bank=mysql_fetch_object($bank)){ $person_bank = mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$fetch_bank->username'")); if ($fetch_bank->int_time <= time()){ $nmoney = round($person_bank->bank * $fetch_bank->interest / 100); $money_inn = $person_bank->bank + $nmoney; $new_money= round($money_inn); $new_time= time() + (3600*24); mysql_query("UPDATE bank SET int_time='$new_time' WHERE username='$person_bank->username'"); mysql_query("UPDATE users SET bank='$new_money' WHERE username='$person_bank->username'"); }} $most_online=mysql_fetch_object(mysql_query("SELECT * FROM site_stats WHERE id='1'")); $timenow=time(); $now_online =mysql_num_rows(mysql_query("SELECT * FROM users WHERE online > '$timenow'")); if ($now_online > $most_online->online){ mysql_query("UPDATE site_stats SET online='$now_online' WHERE id='1'"); } $drop =mysql_query("SELECT * FROM casinos"); while($tard=mysql_fetch_object($drop)){ $per = mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$tard->owner'")); if ($per->status == "Banned"){ mysql_query("UPDATE casinos SET owner='0' WHERE casino='$tard->casino' AND owner='$tard->owner'"); } } if ($info->banktime <= time() && $info->bank > "0"){ $nmoney = 10 * $info->bank / 100; $money_in = $info->bank + $nmoney; $money_in= round($money_in); $recieve = $info->money + $money_in; mysql_query("UPDATE users SET money = '$recieve', bank='0', banktime='0' WHERE username='$username'"); } $user_info=mysql_fetch_object(mysql_query("SELECT * FROM user_info WHERE username='$username'")); if ($user_info->jail_able == "1" && $user_info->jail_untill <= time()){ mysql_query("UPDATE user_info SET jail_able='0' WHERE username='$username'"); } $user_****=mysql_fetch_object(mysql_query("SELECT * FROM user_info WHERE username='$username'")); if ($user_****->last_respect < time() && $fetch->rank != "Scum"){ if ($info->rank == "Wannabe"){ $new_res="1"; } elseif($info->rank == "Thug"){ $new_res="2"; } elseif($info->rank == "Robber"){ $new_res="3"; } elseif($info->rank == "Gangster"){ $new_res="4"; } elseif($info->rank == "Criminal"){ $new_res="5"; } elseif($info->rank == "Wanted Criminal"){ $new_res="6"; } elseif($info->rank == "Hitman"){ $new_res="7";} elseif($info->rank == "Loyal Hitman"){ $new_res="8"; } elseif($info->rank == "Boss"){ $new_res="9"; } elseif($info->rank == "Loyal Boss"){ $new_res="10"; } elseif($info->rank == "Godfather"){ $new_res="11"; } elseif($info->rank == "Don"){ $new_res="12"; } elseif($info->rank == "Legend"){ $new_res="13"; } elseif($info->rank == "Legendary Legend"){ $new_res="14"; } elseif($info->rank == "Moderator"){ $new_res="100"; } elseif($info->rank == "Administrator"){ $new_res="1000000000"; } $now=time() + (3600 * 24 * 7); mysql_query("UPDATE user_info SET respect='$new_res', last_respect='$now' WHERE username='$username'"); } ?><script language=JavaScript> <!-- //Disable right click script III- By Renigade ([email protected]) //For full source code, visit http://www.dynamicdrive.com var message=""; /////////////////////////////////// function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function("return false") // --> </script> And this is the other error. If anyone can help me sort this then please message me. Edited June 4, 2014 by KyleMassacre Changed file name to what it actually is Quote
KyleMassacre Posted June 4, 2014 Posted June 4, 2014 Is that file you posted system.php? If so you can. It include system.php in your system.php For your permission error it looks like you are using the incorrect db user credentials. The error is telling me you are not using a password along with your username to access the database you use for your program. So make sure you are using the correct user and password for that Quote
KaineBennett Posted June 4, 2014 Author Posted June 4, 2014 I mean thats the Server.php not the System.php my mistake. Quote
KyleMassacre Posted June 4, 2014 Posted June 4, 2014 Well the file you are showing us doesn't seem to have helpful information about your error other than the error is telling you hat you are redeclaring the class System again. So it sounds like you may be including System.php 2 or more times in a single file Quote
KaineBennett Posted June 4, 2014 Author Posted June 4, 2014 Ok this is the file where the file is showing the error <?php session_start(); include "Includes/Server.php"; logincheck(); $username=$_SESSION['username']; include "Includes/System.php"; $date = gmdate('Y-m-d h:i:s'); $locationa = mysql_query("SELECT money, crew, rank FROM users WHERE username='$username'"); while($successa = mysql_fetch_row($locationa)){ $crew = $successa[1]; $money = $successa[0]; $rank = $successa[2]; } $wanka = mysql_query("SELECT * FROM crews"); while($toss = mysql_fetch_row($wanka)){ $cnt++; } if ($crew == '0'){ if ($_POST['Create']){ $crewname=strip_tags($_POST['crewname']); $size=strip_tags($_POST['size']); if($cnt >= 50){ die("No More Crew Spaces Available Try Again Soon!"); } $blahhh = mysql_query("SELECT * FROM `crews` WHERE name = '$crewname'"); $madecrew = mysql_num_rows($blahhh); if($madecrew != "0") { die('There is already a crew with this name'); } if (!$crewname){ echo "You need to enter a name for your crew."; }elseif ($crewname){ if ($crew != '0'){ echo "You are already in a crew."; }elseif ($crew == '0'){ if ($size == 1){ $price = 2500000; $users = 10; }elseif ($size == 2){ $price = 10000000; $users = 25; }elseif ($size == 3){ $price = 20000000; $users = 50; }elseif ($size == 4){ $price = 30000000; $users = 100; }elseif ($size == 5){ $price = 50000000; $users = 10000; } $fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'")); if($fetch->money>$price){}else{die("You haven't got enough money!");} mysql_query("UPDATE users SET money=money-$price WHERE username='$username'") or die("Couldnt substract cash!"); mysql_query("INSERT INTO `crews` (`id`, `name`, `boss`, `underboss`, `money`, `recruiting`, `quote`,`image`,`rep`,`size`,`recruiter1`,`recruiter2`) VALUES ('', '$crewname', '$username', '0', '0', '0','No crew profile added!','Images/Default.png','0','$users','0','0');") or die (mysql_error()); mysql_query("UPDATE users SET crew='$crewname' WHERE username='$username'"); echo "<link href='CssStyle.css' rel='stylesheet' type='text/css' /> <table width='400' border='0' align='center' cellpadding='3' cellspacing='1' class='table'><tr class='header'><td align='center'>Crew</td></tr><tr><td align='center' bgcolor=555555>The Crew $crewname Has Been Made!</td></tr></table><br>"; }}} ?> <html> <link rel="stylesheet" href="style3.css" type="text/css"> <center> <table class=table width="420" border="0" align="center" cellpadding="3" cellspacing="1" bordercolor=black> <tr> <td colspan="3" class="header">Create A Crew</td> </tr> <tr> <td class="TableArea" bgcolor=555555 ><form action'' method=post>Crew Name:</td> <td class="TableArea" colspan="2" bgcolor=555555><input type=text class="textinput" name=crewname></td> </tr> <tr> <td class="forum" bgcolor=555555><b>Crew</b></td> <td class="forum" bgcolor=555555><b>Max Members</b></td> <td class="forum" bgcolor=555555><b>Cost</b></td> </tr> <tr> <td class="TableArea" bgcolor=555555><input type=radio name=size value=1 checked> Small</td> <td class="TableArea" bgcolor=555555>10 Members</td> <td class="TableArea" bgcolor=555555>�2,500,000</td> </tr> <tr> <td class="TableArea" bgcolor=555555><input type=radio name=size value=2> Medium</td> <td class="TableArea" bgcolor=555555>25 Members</td> <td class="TableArea" bgcolor=555555>�10,000,000</td> </tr> <tr> <td class="TableArea" bgcolor=555555><input type=radio name=size value=3> Large</td> <td class="TableArea" bgcolor=555555>50 Members</td> <td class="TableArea" bgcolor=555555>�20,000,000</td> </tr> <tr> <td class="TableArea" bgcolor=555555><input type=radio name=size value=4> Large</td> <td class="TableArea" bgcolor=555555>100 Members</td> <td class="TableArea" bgcolor=555555>�30,000,000</td> </tr> <tr> <td class="TableArea" bgcolor=555555><input type=radio name=size value=5> Unlimited</td> <td class="TableArea" bgcolor=555555>Unlimted Members</td> <td class="TableArea" bgcolor=555555>�50,000,000</td> </tr> <tr> <td class="TableArea" colspan="3" bgcolor=555555><center><input type=submit class="button" value="Submit" name='Create'></center></td> </tr> </table> </form> <?php }elseif ($crew != '0'){ $ab = mysql_query("SELECT bank, size, rhm, name, owner, id, lhm FROM crews WHERE name='$crew'"); while($abc = mysql_fetch_row($ab)){ $bank = $abc[0]; $size = $abc[1]; $rhm = $abc[2]; $crewname = $abc[3]; $owner = $abc[4]; $id222 = $abc[5]; $lhm = $abc[6]; } $ear2n=mysql_fetch_object(mysql_query("SELECT * FROM crews WHERE name='$crewname'")); $earn=$ear2n->income; $payout=$ear2n->payout; $boo="SELECT * FROM users WHERE crew='$crewname'"; $he=mysql_query($boo); $increw=mysql_numrows($he); $earn=round($earn/$increw); if($payout <= time()){ $pas=time()+86400; mysql_query("UPDATE users SET money=money+$earn WHERE crew='$crewname'") or die("Couldn't add cash!"); print""; } ?> <html> <link rel=stylesheet href=CssStyle.css type=text/css> <center> <html> <center> <link href='CssStyle.css' rel='stylesheet' type='text/css' /> <title>Racing Warz - Crew Cp</title> <br><table width='400' border='0' align='center' cellpadding='3' cellspacing='1' class='table'> <tr class='header'><td align='center'>Error</td></tr><tr><td align='center' bgcolor=555555>Go To Your Crew ManageMent Page To Control Your Crew!</td></tr></table><br> <table width='20%' border='0' align='center' cellpadding='3' cellspacing='1' class='table' bordercolor=black> <tr> <td class='header'>Leave Crew</td> </tr> <tr> <td class='TableArea' align='center' bgcolor=555555> <form action='' method=post> <input type=submit class='button' value='Leave' name=rhmleave> </form> </td> </tr> </table> <? if (strip_tags($_POST['rhmleave'])){ mysql_query("UPDATE crews SET rhm='0' WHERE name='$crewname'"); mysql_query("UPDATE users SET crew='0' WHERE username='$username'"); die("You have left the crew!"); }} ?> <html> <link rel='stylesheet' href='includes/in.css' type='text/css'> <center> <br> Quote
KyleMassacre Posted June 4, 2014 Posted June 4, 2014 Look at lines 7 and 16, what do to see? And is that file included on every page? If so I would remove it from the rest of the pages Quote
KaineBennett Posted June 4, 2014 Author Posted June 4, 2014 On line 16 there is nothing there? And yeah the server and system is on every page.... So I remove the Server bit from the System bit? Quote
KyleMassacre Posted June 4, 2014 Posted June 4, 2014 Well on my phone it looks like those are the lines the issues are on. But you are including the same file twice Quote
KaineBennett Posted June 4, 2014 Author Posted June 4, 2014 Ahh I get you, I just decided to start coding a new one instead. Any idea how to do the iFrame as it keeps opening in a new tab Quote
KaineBennett Posted June 4, 2014 Author Posted June 4, 2014 Ahh I get you, I just decided to start coding a new one instead. Any idea how to do the iFrame as it keeps opening in a new tab Quote
Script47 Posted June 4, 2014 Posted June 4, 2014 To open a link in a new tab (if that is what you want): <a href="someURL" target="_blank">Your Link Display</a> W3Schools Quote
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.