gulley Posted October 12, 2008 Share Posted October 12, 2008 :-D :-D :-D :-D :-D :-DParse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/pyro/public_html/pimp/cyberbank.php on line 81 What Do I Need To Do To Remove That? <?php include "globals.php"; print "<h3>Cyber Bank</h3>"; if($ir['cybermoney']>-1) { switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money']>9999999) { print "Congratulations, you bought a bank account for \$10,000,000! [url='cyberbank.php']Start using my account[/url]"; $db->query("UPDATE users SET money=money-10000000,cybermoney=0 WHERE userid=$userid"); } else { print "You do not have enough money to open an account. [url='explore.php']Back to town...[/url]"; } } else { print "Open a bank account today, just \$10,000,000! [url='cyberbank.php?buy']> Yes, sign me up![/url]"; } } function index() { global $db,$ir,$c,$userid,$h; print "\n[b]You currently have \${$ir['cybermoney']} in the bank.[/b] At the end of each day, your bank balance will go up by 7%. <table width='75%' border='2'> <tr> <td width='50%'>[b]Deposit Money[/b] It will cost you 15% of the money you deposit, rounded up. The maximum fee is \$1,500,000.<form action='cyberbank.php?action=deposit' method='post'> Amount: <input type='text' name='deposit' value='{$ir['money']}' /> <input type='submit' value='Deposit' /></form></td> <td> [b]Withdraw Money[/b] It will cost you 7.5% of the money you withdraw, rounded up. The maximum fee is \$750,000.<form action='cyberbank.php?action=withdraw' method='post'> Amount: <input type='text' name='withdraw' value='{$ir['cybermoney']}' /> <input type='submit' value='Withdraw' /></form></td> </tr> </table>"; } function deposit() { global $db,$ir,$c,$userid,$h; $_POST['deposit']=abs((float) $_POST['deposit']); if($_POST['deposit'] > $ir['money']) { print "You do not have enough money to deposit this amount."; } else { $fee=ceil($_POST['deposit']*15/100); if($fee > 1500000) { $fee=1500000; } $gain=$_POST['deposit']-$fee; $ir['cybermoney']+=$gain; $db->query("UPDATE users SET cybermoney=cybermoney+$gain, money=money-{$_POST['deposit']} where userid=$userid"); print "You hand over \${$_POST['deposit']} to be deposited, after the fee is taken (\$$fee), \$$gain is added to your account. [b]You now have \${$ir['cybermoney']} in the Cyber Bank.[/b] [url='cyberbank.php']> Back[/url]"; } } function withdraw() { global db,$ir,$c,$userid,$h; $_POST['withdraw']=abs((float) $_POST['withdraw']); if($_POST['withdraw'] > $ir['cybermoney']) { print "You do not have enough banked money to withdraw this amount."; } else { $fee=ceil($_POST['withdraw']*75/1000); if($fee > 750000) { $fee=750000; } $gain=$_POST['withdraw']-$fee; $ir['cybermoney']-=$gain; $db->query("UPDATE users SET cybermoney=cybermoney-$gain, money=money+$gain where userid=$userid"); print "You ask to withdraw $gain, the teller hands it over after she takes the bank fees. [b]You now have \${$ir['cybermoney']} in the Cyber Bank.[/b] [url='cyberbank.php']> Back[/url]"; } } $h->endpage(); ?> thanks :-D Quote Link to comment Share on other sites More sharing options...
Tezza` Posted October 12, 2008 Share Posted October 12, 2008 Re: Need Help I Have A Prob Line 81 is..... global db,$ir,$c,$userid,$h; Quote Link to comment Share on other sites More sharing options...
gulley Posted October 12, 2008 Author Share Posted October 12, 2008 Re: Need Help I Have A Prob Do I Remove That? Quote Link to comment Share on other sites More sharing options...
Tezza` Posted October 12, 2008 Share Posted October 12, 2008 Re: Need Help I Have A Prob No... i didn't say that, just stating to people that is line 81, as in the code there is no line numbers. I don't know PHP, i would not know what to do, use trail and error, (global db,$ir,$c,$userid,$h;) remove then $ir, if that dont work, put it back, and remove $c, if that dont work, put it back and remove $userid etc etc. You learn from your mistakes. Quote Link to comment Share on other sites More sharing options...
Jeff Posted October 13, 2008 Share Posted October 13, 2008 Re: Need Help I Have A Prob Line 81 is..... global db,$ir,$c,$userid,$h; Should be global $db,$ir,$c,$userid,$h; I havn't used mccodes in a long time but im sure its meant to be global $db not global db <?php include "globals.php"; print "<h3>Cyber Bank</h3>"; if($ir['cybermoney']>-1) { switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money']>9999999) { print "Congratulations, you bought a bank account for \$10,000,000! [url='cyberbank.php']Start using my account[/url]"; $db->query("UPDATE users SET money=money-10000000,cybermoney=0 WHERE userid=$userid"); } else { print "You do not have enough money to open an account. [url='explore.php']Back to town...[/url]"; } } else { print "Open a bank account today, just \$10,000,000! [url='cyberbank.php?buy']> Yes, sign me up![/url]"; } } function index() { global $db,$ir,$c,$userid,$h; print "\n[b]You currently have \${$ir['cybermoney']} in the bank.[/b] At the end of each day, your bank balance will go up by 7%. <table width='75%' border='2'> <tr> <td width='50%'>[b]Deposit Money[/b] It will cost you 15% of the money you deposit, rounded up. The maximum fee is \$1,500,000.<form action='cyberbank.php?action=deposit' method='post'> Amount: <input type='text' name='deposit' value='{$ir['money']}' /> <input type='submit' value='Deposit' /></form></td> <td> [b]Withdraw Money[/b] It will cost you 7.5% of the money you withdraw, rounded up. The maximum fee is \$750,000.<form action='cyberbank.php?action=withdraw' method='post'> Amount: <input type='text' name='withdraw' value='{$ir['cybermoney']}' /> <input type='submit' value='Withdraw' /></form></td> </tr> </table>"; } function deposit() { global $db,$ir,$c,$userid,$h; $_POST['deposit']=abs((float) $_POST['deposit']); if($_POST['deposit'] > $ir['money']) { print "You do not have enough money to deposit this amount."; } else { $fee=ceil($_POST['deposit']*15/100); if($fee > 1500000) { $fee=1500000; } $gain=$_POST['deposit']-$fee; $ir['cybermoney']+=$gain; $db->query("UPDATE users SET cybermoney=cybermoney+$gain, money=money-{$_POST['deposit']} where userid=$userid"); print "You hand over \${$_POST['deposit']} to be deposited, after the fee is taken (\$$fee), \$$gain is added to your account. [b]You now have \${$ir['cybermoney']} in the Cyber Bank.[/b] [url='cyberbank.php']> Back[/url]"; } } function withdraw() { global $db,$ir,$c,$userid,$h; $_POST['withdraw']=abs((float) $_POST['withdraw']); if($_POST['withdraw'] > $ir['cybermoney']) { print "You do not have enough banked money to withdraw this amount."; } else { $fee=ceil($_POST['withdraw']*75/1000); if($fee > 750000) { $fee=750000; } $gain=$_POST['withdraw']-$fee; $ir['cybermoney']-=$gain; $db->query("UPDATE users SET cybermoney=cybermoney-$gain, money=money+$gain where userid=$userid"); print "You ask to withdraw $gain, the teller hands it over after she takes the bank fees. [b]You now have \${$ir['cybermoney']} in the Cyber Bank.[/b] [url='cyberbank.php']> Back[/url]"; } } $h->endpage(); ?> Quote Link to comment 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.