Jump to content

burtybob

Members
  • Posts

    105
  • Joined

  • Last visited

Everything posted by burtybob

  1. Thank you this did work after i corrected one minor probelm with your code it was missing a ` but everything else was right so thank you very much.
  2. Almost right but where satff 1 or 2 is NOT set to adminben/the players name.
  3. $sql=mysql_query("SELECT * FROM report WHERE (`verdict` = '') AND ((`staff1` = '') OR (`staff2` = '') OR (`staff3` = '')) AND (`staff1` != 'Adminben') ORDER BY `dtreported` ASC"); WORKS however $sql=mysql_query("SELECT * FROM report WHERE (`verdict` = '') AND ((`staff1` = '') OR (`staff2` = '') OR (`staff3` = '')) AND ((`staff1` != 'Adminben') OR (`staff2` !='Adminben')) ORDER BY `dtreported` ASC"); DOESNT. Again Both staff1 and staff2 are set but when i check just staff1 it works but as soon as i try that staff2 using the ( ) Double bracket method it breaks and just shows all of them even if if staff1 != Adminben. Sorry to ask AGAIN but please does any one know why this is happening??? Many thanks in advance!
  4. I have: $sql=mysql_query("SELECT * FROM report WHERE (`verdict` = '') AND (`staff1` = '') OR (`staff2` = '') OR (`staff3` = '') AND (`staff1` != 'Adminben') ORDER BY `dtreported` ASC"); And BTW satff1 is = Adminben and yet it still selects and show it!!! Does anyone have any idea why this is i have tried also using a variable in their so as to automate it but to the same result. Many thanks in advance.
  5. Sorry you are right i did miss that piece of code and it now doesnt echo when the variable isnt set, thank you can i please ask what the print_r actually does because in the php manual it says its to do with arrays is this true? Thank you!
  6. If you read my post i did try this also mmmvomit i have tried the isset() method and as someone pointed out the variable does set! Even if it is $staff='' still becomes 'set'
  7. OOPs Programming lol!!!! (very bad pun) Now i am checking to see if its empty and im using same code as before but instead of isset() im using empty () and even when its got data it still echos hello!!! any ideas? I even tried manually giveing the variable a value in the code and still it echos!!! Please? Grr i even tell the code to echo if its empty and it actually echos a value!
  8. yh i know but there isnt anydata going into it maybe i should be using if (empty(variable)){ execute code } ????? Thanks for the fast reply!
  9. I have a piece of code sayin $staff1 = $_REQUEST['staff1']; // also tried with $_GET and $_POST but neither worked for me if (isset($staff1)) { echo "hello"; } And i am not 'setting' the variable so why is it echoing the hello (i am going to turn the actual true statement into a usefull thing but i thought echoing something i would be able to see if it is working) Please can anyone help as i have spent the last week looking thorugh this code to make sure nothing is passed to the variable to be able to set it.
  10. Yes this is what i meant so that i can include all my current incliudes into one so as to make for smaller code but easyness as well. So that i just have one include in each file file instead of loads. Thank you for your help.
  11. This may sound dumb but is it possible to have 1 file which includes all the files that you might need to include in any document? EG include('masterfile'); In master file, include ('file1'); include ('file2'); include ('file3'); Etc etc?
  12. Ok... Here is my ENTIRE Code for the bank page. <?php include("dbconnect.php"); include("playerchecks.php"); include("checkhospjail.php"); include("fn_sendmessage.php"); if (empty($c_userid)) { header("Location: index.php"); exit; } else { /********************************************** ** GET PLAYERS EXISTING MONEY FOR DEPOSIT ALL** ***********************************************/ $gtaid=secureint($_POST['gtaid']); $depall=$_POST['depall']; $witall=$_POST['witall']; $fetch=mysql_fetch_array(mysql_query("SELECT * FROM members WHERE `userid`='$c_userid'")); $moneys=$fetch[money]; /*************************************** ** GET PLAYER'S EXISTING BANK BALANCE ** ***************************************/ $fetch=mysql_fetch_array(mysql_query("SELECT * FROM members WHERE `userid`='$c_userid'")); $bankmoney=$fetch[bankmoney]; $banktime=$fetch[banktime]; $bankremain=$banktime-time(); $moneys=$fetch[money]; /*************************************************** ** CHECK IF 24 HOURS HAS EXPIRED AND ADD INTEREST ** ***************************************************/ if ($bankremain<=0) { $plmoney+=$bankmoney+($bankmoney-intval($bankmoney*1.05)); $bankmoney=0; $banktime=0; $bankremain=0; } /************************************** ** PLAYER WANTS TO USE THEIR ACCOUNT ** **************************************/ $outtime=time()+(24*60*60); //24 hours if (isset($depall)) { $allmony = mysql_query("SELECT money FROM members WHERE userid = $c_userid"); mysql_query("UPDATE members SET `bankmoney`=$allmony,`money`='0',`banktime`='$outtime' WHERE `userid`='$c_userid'"); } else if(isset($witall)) { $allmonya = mysql_query("SELECT bankmoney FROM members WHERE userid = $c_userid"); mysql_query("UPDATE members SET `money`=money+'$allmonya',`bankmoney`='0' WHERE `userid`='$c_userid'"); } else { if ($_POST['subbalance']) { $amount=secureint($_POST['amount']); if ($amount>0) { $action=secureint($_POST['action']); if ($action==1) { //Player wants to credit their account if ($plmoney<$amount) {$message="You can't credit your account with money you don't have";} else { $outtime=time()+(24*60*60); //24 hours $plmoney-=$amount; //Remove money from the player's hand if ($bankmoney>0) {//Player wants to credit an existing balance mysql_query("UPDATE members SET `money`=money-'$amount',`bankmoney`=bankmoney+'$amount',`banktime`='$outtime' WHERE `userid`='$c_userid'"); $message="You added $".number_format($amount)." to your account - in 24 hours you'll receive 5% interest"; $bankmoney+=$amount; } else { mysql_query("UPDATE members SET `money`=money-'$amount',`bankmoney`='$amount',`banktime`='$outtime' WHERE `userid`='$c_userid'"); $message="You credited your account with $".number_format($amount)." - in 24 hours you'll receive 5% interest"; $bankmoney=$amount; } } $bankremain=(24*60*60)-1; } else { //Player wants to debit their account if ($amount>$bankmoney) {$message="You don't have that much in your account";} else { if ($amount<$bankmoney) { //Player wants to withdraw some of their money mysql_query("UPDATE members SET `money`=money+'$amount',`bankmoney`=bankmoney-'$amount' WHERE `userid`='$c_userid'"); $message="You debited $".number_format($amount)." from your account"; $bankmoney-=$amount; } else { //Player wants to withdraw all of their money mysql_query("UPDATE members SET `money`=money+'$amount',`bankmoney`='0',`banktime`='0' WHERE `userid`='$c_userid'"); $message="You withdrew all your money from your account"; $bankmoney=0; $bankremain=0; } } } } else {$message="Invalid amount - please try again";} } } /************************************ ** PLAYER WANTS TO SEND SOME MONEY ** ************************************/ if ($_POST['subsend']) { $sendname=securestr($_POST['sendname']); if (empty($sendname)) {$message="You need to specify who you want to give to";} else { $fetch=mysql_fetch_array(mysql_query("SELECT displayname FROM members WHERE `displayname`='$sendname'")); $sendname=$fetch[displayname]; if (empty($sendname)) {$message="That player doesn't exist";} else { $sendamount=secureint($_POST['sendamount']); if ($_POST['sendmessage']) {$sendmsg=true;} else {$sendmsg=false;} if ($sendamount<100||$sendamount>$plmoney) {$message="Invalid amount - please try again";} else { $checkcode=md5(secureint($_POST['chkcode'])); if ($checkcode==$_SESSION['vcode']) { mysql_query("UPDATE members SET `money`=money-'$sendamount' WHERE `userid`='$c_userid'"); //Remove money "from" $receiveamount=intval($sendamount*0.9); mysql_query("UPDATE members SET `money`=money+'$receiveamount' WHERE `displayname`='$sendname'"); //Give money "to" mysql_query("INSERT INTO banktransfers (`from`,`to`,`amount`,`dt`) VALUES ('$plname','$sendname','$sendamount',NOW() )"); $message='You sent <a href="viewprofile.php?user='.$sendname.'">'.$sendname.'</a> $'.number_format($sendamount).', after bank charges they received $'.number_format($receiveamount); if ($sendmsg) { $sendmsg='sent you $'.number_format($sendamount).'.\n\nAfter bank charges you received $'.number_format($receiveamount).'.'; sendmessage($plname,$sendname,$sendmsg,5); } } else {$message="The code doesn't verify - please try again";} } } } } /*********************************** ** GET LAST 10 BANK TRANSFERS OUT ** ***********************************/ $outhtml=""; $query=mysql_query("SELECT * FROM banktransfers WHERE `from`='$plname' ORDER BY `dt` DESC LIMIT 10"); while ($fetch=mysql_fetch_array($query)) { $outhtml.='<tr class="tblin"><td class="gtext"><a href="viewprofile.php?user='.$fetch[to].'">'.$fetch[to].'</a></td><td class="gtextr">$'.number_format($fetch[amount]).'</td><td class="gtextc">'.gmdate("d-m \a\\t H:i",strtotime($fetch[dt])).'</td></tr>'; } /********************************** ** GET LAST 10 BANK TRANSFERS IN ** **********************************/ $inhtml=""; $query=mysql_query("SELECT * FROM banktransfers WHERE `to`='$plname' ORDER BY `dt` DESC LIMIT 10"); while ($fetch=mysql_fetch_array($query)) { $inhtml.='<tr class="tblin"><td class="gtext"><a href="viewprofile.php?user='.$fetch[from].'">'.$fetch[from].'</a></td><td class="gtextr">$'.number_format($fetch[amount]).'</td><td class="gtextc">'.gmdate("d-m \a\\t H:i",strtotime($fetch[dt])).'</td></tr>'; } echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Lealta alla Famiglia :: Game Information</title> <link rel="stylesheet" type="text/css" href="main.css" /> <script language="JavaScript" type="text/javascript""> function doFocus() { document.myform.amount.focus(); } </script> </head> <body onload="doFocus();" onmouseover="window.status='Lealta alla Famiglia :: Bank';return true;" onmouseout="window.status='';return true;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr><td colspan="3"><?php include("titlebar.php"); ?></td></tr> <tr><td colspan="3"><hr></td></tr> <tr> <td width="130" valign="top" align="left"><?php include("menu.php"); ?></td> <td valign="top" class="playarea" align="center" width="100%"> <br /><?=$message?><br /><br /> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="myform"> <table cellspacing="0" cellpadding="0" border="0"> <tr><td align="center" valign="top"> <table cellspacing="0" cellpadding="0" class="tblout"> <tr class="tblin"><td class="tblhdr" colspan="2">Bank</td></tr> <tr class="tblin"><td class="gtext">Balance</td><td class="gtext">$<?php echo number_format($bankmoney); ?></td></tr> <tr class="tblin"><td class="gtext">Time Left</td><td class="gtext"><?php if ($bankremain<0) {echo "00:00:00";} else {echo gmdate("H:i:s",$bankremain);} ?></td></tr> <tr class="tblin"><td class="gtext">Amount</td><td class="gtext"><input type="text" name="amount" size="16" maxlength="10" class="textbox" /></td></tr> <tr class="tblin"><td class="gtext">Action</td><td class="gtext"><input type="radio" name="action" value="1" checked="checked" /> Credit <input type="radio" name="action" value="2" /> Debit</td></tr> <tr class="tblin"><td class="gtextc" colspan="2"><input type="submit" name="subbalance" value=" Make Transaction " class="button" /></td></tr> <tr class="tblin"><td class="gtextc" colspan="2"><input type="submit" name="depall" value=" Deposit All" class="button" /></td></tr> <tr class="tblin"><td class="gtextc" colspan="2"><input type="submit" name="witall" value=" Withdraw All" class="button" /></td></tr> </table><br /> <table cellspacing="0" cellpadding="0" class="tblout"> <tr class="tblin"><td class="tblhdr" colspan="2">Transfer Money</td></tr> <tr class="tblin"><td class="gtext">Who to?</td><td class="gtext"><input type="text" name="sendname" size="21" maxlength="20" class="textbox" /></td></tr> <tr class="tblin"><td class="gtext">Amount</td><td class="gtext"><input type="text" name="sendamount" size="16" maxlength="10" class="textbox" /></td></tr> <tr class="tblin"><td class="gtext">Message</td><td class="gtext"><input type="checkbox" name="sendmessage" /></td></tr> <tr class="tblin"><td class="gtextc" colspan="2">Enter verification code:<br /><img src="verifycode.php" width="55" height="15" border="0" /> <input type="text" name="chkcode" size="7" maxlength="6" class="textbox" /></td></tr> <tr class="tblin"><td class="gtextc" colspan="2"><input type="submit" name="subsend" value=" Send " class="button" /></td></tr> </table> </td> <td width="18"> </td> <td align="center" valign="top"> <?php if (!empty($outhtml)) { ?> <table cellspacing="0" cellpadding="0" class="tblout"> <tr class="tblin"><td class="tblhdr" colspan="3">Last 10 Outgoing</td></tr> <tr class="tblin"><td class="gsubhdr">Name</td><td class="gsubhdr">Amount</td><td class="gsubhdr">When</td></tr> <?=$outhtml?> </table><br /> <?php } ?> <?php if (!empty($inhtml)) { ?> <table cellspacing="0" cellpadding="0" class="tblout"> <tr class="tblin"><td class="tblhdr" colspan="3">Last 10 Incoming</td></tr> <tr class="tblin"><td class="gsubhdr">Name</td><td class="gsubhdr">Amount</td><td class="gsubhdr">When</td></tr> <?=$inhtml?> </table> <?php } ?> </td></tr> </table> </form> </td> </tr> </table> </body> </html> <?php } ?> I have tried several things and i can only ever get parts to work like deposit or bank time or neither to work.... And i allready have the db with time and that to log it, that works as long as it isnt via the buttons of dep/wit all.
  13. so basicall same as above but instead of (empty) use (isset)? This works mostly but it deposits it and then withdrawable but it doesnt display that it has done either in the ballance area. Ok heres the code i am using. if (isset($depall)) { $allmony = mysql_query("SELECT money FROM members WHERE userid = $c_userid"); mysql_query("UPDATE members SET `bankmoney`=$allmony,`money`='0',`banktime`='$outtime' WHERE `userid`='$c_userid'"); } else if(isset($witall)) { $allmonya = mysql_query("SELECT bankmoney FROM members WHERE userid = $c_userid"); mysql_query("UPDATE members SET `money`=money+'$allmonya',`bankmoney`='0' WHERE `userid`='$c_userid'"); } else {
  14. so basicall same as above but instead of (empty) use (isset)?
  15. I have got the bit that updaates the mysql database but it doesnt do it, i have if (!empty($buttonvariable)){ update the database } Rest of code To put it simply. but it doenst update the database and btw it is game money.
  16. Ok... I have a problem and can i say firstly i dont want code but an explanation on how to do this, i would like to know how can i make a bank script have a button(which i have got) but then one says Deposit all and the other one says Withdraw all, How would i go about making it so that they do exactly what it says on the button, would it be that i treat the buttons like a normal part of the form? or how? Please dont post code as i would like to code it fully myself although if you need to post code to make it easier to explain please feel free.
  17. This should realy be under editor help- ZEND.
  18. Thanks one of my mates that helps to code, has just realised that the time in the db that it is getting is the first one on the list which is why it is totally messing so thank you for your help, even though it idnt work it has tidied my code up a lot.
  19. No the prices are fine but the time goes into minus when i go on the page the time from the DB - Current time for some reason seem to go into minuse. 1189102314 <---- Time now Time 4: -1189015805 <------ Time in DB - Time now So because it never hits 0 it never automatically updates the DB.
  20. That code still gives me a minus and doesnt update the db unless i rtefresh the page, my idea is that it updates it every so often my i should use on of my other scripts and edit that, thank you for your advice tho.
  21. I have a code that should update a table named drugs after 2 hours however when i try the code i get the data from the database but it then goes into minus plus can some one look at my code and tell me why it goes minus instead? <?php $con = mysql_connect("sql address","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("database", $con); $londonpdp=mt_rand(99,999); $oslopdp=mt_rand(98,999); $cairopdp=mt_rand(99,999); $shanghaipdp=mt_rand(99,999); $parispdp=mt_rand(99,999); $dublinpdp=mt_rand(99,999); $riopdp=mt_rand(99,999); $stockholmpdp=mt_rand(99,999); $athenspdp=mt_rand(99,999); $montrealpdp=mt_rand(99,999); $washingtonpdp==mt_rand(99,999); $time1=mysql_query("SELECT pricetime FROM drugs"); $outtime=time()+(24*60*60); //24hours $time4= $time1-time(); if ($time4<=0) { mysql_query("UPDATE drugs SET londonprice = '$londonpdp' WHERE drugname = 'pot'"); mysql_query("UPDATE drugs SET osloprice = '$oslopdp' WHERE drugname = 'pot'"); mysql_query("UPDATE drugs SET cairoprice = '$cairopdp' WHERE drugname = 'pot'"); mysql_query("UPDATE drugs SET shanghaiprice = '$shanghaipdp' WHERE drugname = 'pot'"); mysql_query("UPDATE drugs SET washingtonprice = '$washingtonpdp' WHERE drugname = 'pot'"); mysql_query("UPDATE drugs SET dublinprice = '$dublinpdp' WHERE drugname = 'pot'"); mysql_query("UPDATE drugs SET parisprice = '$parispdp' WHERE drugname = 'pot'"); mysql_query("UPDATE drugs SET rioprice = '$riopdp' WHERE drugname = 'pot'"); mysql_query("UPDATE drugs SET stockholmprice = '$stockholmpdp' WHERE drugname = 'pot'"); mysql_query("UPDATE drugs SET athensprice = '$athenspdp' WHERE drugname = 'pot'"); mysql_query("UPDATE drugs SET montrealprice = '$montrealpdp' WHERE drugname = 'pot'"); mysql_query("UPDATE drugs SET pricetime = '$outtime' WHERE drugname = 'pot'"); } mysql_close($con); echo "$outtime <br>"; echo "Time 4: $time4 <br>"; ?> d
  22. What is a PvP page? Sorry Payer Vs Player.
  23. Hi, Does anyone know a good PvP tutorial, doesnt have to be easy to follow however it would be nice, or even if someone could write a VERY basic one on how to creat PvP pages. I mean i only really need the basics and a explantion how it works, i did search on here and the main site but couldnt find one.
  24. realy? wow i didnt know that as the code i used worked but i will try that and see if that solves it! EDIT: nope that didnt solve it i looked at news.php and couldnt find anything in thier to redirect it... /*************************** ** PLAYER WANTS TO LOG IN ** ***************************/ if ($_POST['sublogin']) { if ($_POST['login']) { $login=securestr($_POST['login']); if ($_POST['pass']) { $pass=securestr($_POST['pass']); $check=mysql_fetch_array(mysql_query("SELECT * FROM members")); $dblogin=$check[loginname]; $dbpass=$check[password]; if ($login==$dblogin&&$dbpass==$pass) { $pluserid=$check[userid]; $pldisplay=$check[displayname]; $placcesslevel=$check[accesslevel]; $plactivated=$check[activated]; $plgender=$check[gender]; $plcrewid=$check[crewid]; $plalive=$check[alive]; $plstatus=$check[status]; $ipaddress=GetHostByName($REMOTE_ADDR); mysql_query("UPDATE members SET `lastip`='$ipaddress' WHERE `userid`='$pluserid'"); //Record the player's current IP Is there anyway to write in a loop so that it checks ALL users in the db rather than just the top one? I have tried WHILE and DO WHILE, but these just bring up a blank white page.
×
×
  • 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.