Lilith Posted January 7, 2011 Share Posted January 7, 2011 I am going to guess that the code is not placed in the file right.... having the entire code will help. When limiting acess to a file, I like to place it right after where you call globals.php, this way, none of the script runs until that if statement resolves. Quote Link to comment Share on other sites More sharing options...
Paul Evans Posted January 7, 2011 Share Posted January 7, 2011 yeah for example if the entire file isn't accessible until a user is level 5 then the top of the file would look like this <?php include_once('globals.php'); if ( $ir['level'] < 5 ) { echo 'You cannot enter this page till your level 5.'; die($h->endpage()); } Quote Link to comment Share on other sites More sharing options...
Zan Posted January 8, 2011 Author Share Posted January 8, 2011 <?php include "globals.php"; switch($_GET['step']) { case 'index': casino_index(); break; default: casino_index(); break; } function casino_index() { global $db,$ir,$c,$userid,$h; $tresder = (int) (rand(100,999)); echo "<table><tr><td><center> Welcome to the __________ casino. Take a look around and see if there is anything you would like to play. You have {$ir['casinotokens']} casino tokens. [url='slotsmachine.php?']> Slots[/url] [url='arcade.php']> Arcade[/url] [url='lucky.php']> Lucky Boxes[/url] [url='slots.php']> 7's and Stripes Slots[/url] [url='roulette.php']> Roulette[/url]</td> </tr></table>"; } $h->endpage(); ?> Here is my casino..i want people to be able to enter this page only when they are level 5 Quote Link to comment Share on other sites More sharing options...
Paul Evans Posted January 8, 2011 Share Posted January 8, 2011 <?php include "globals.php"; if ( $ir['level'] < 5 ) { echo 'You cannot enter this page till your level 5.'; die($h->endpage()); } switch($_GET['step']) { case 'index': casino_index(); break; default: casino_index(); break; } function casino_index() { global $db,$ir,$c,$userid,$h; $tresder = (int) (rand(100,999)); echo "<table><tr><td><center> Welcome to the __________ casino. Take a look around and see if there is anything you would like to play. You have {$ir['casinotokens']} casino tokens. [url='slotsmachine.php?']> Slots[/url] [url='arcade.php']> Arcade[/url] [url='lucky.php']> Lucky Boxes[/url] [url='slots.php']> 7's and Stripes Slots[/url] [url='roulette.php']> Roulette[/url]</td> </tr></table>"; } $h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
Joshua Posted January 8, 2011 Share Posted January 8, 2011 heh heh. Quote Link to comment Share on other sites More sharing options...
Paul Evans Posted January 8, 2011 Share Posted January 8, 2011 but people can auto goto the other links slots and so on so you'll need it in there also 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.