Naffer20 Posted November 18, 2011 Posted November 18, 2011 I have 'Streets.php' this was an upgraded mod i've had for years. One problem though, when they find something good they can just refresh the page an get it over & over again. What can i do to stop this? I've tried { die ("Error, you cannot refresh or go back on the streets, please use a side link to go somewhere else.<br /> <a href='streets.php'>> Back</a>"); } Doesn't work.. Help Please :D Quote
chicka Posted November 18, 2011 Posted November 18, 2011 This is a snippet of code I got from slotmachine.php from mccodes. You'll hve to edit it to work for you but this should help you out $_GET['tresde']=abs((int) $_GET['tresde']); if(($_SESSION['tresde'] == $_GET['tresde']) || $_GET['tresde']<100) { die ("Error, you cannot refresh or go back on the slots, please use a side link to go somewhere else.<br /> <a href='slotsmachine.php?tresde=$tresder'>> Back</a>"); } $_SESSION['tresde']=$_GET['tresde']; Quote
gurpreet Posted November 18, 2011 Posted November 18, 2011 Check their number of steps before this die? Also chicka, that would only work if you link it like this: $randnum = mt_rand(1,1000); //Not sure what numbers it is <a href='steets.php?tresde='$randnum'>Streets</a> You would need to generate that random number first. Quote
chicka Posted November 19, 2011 Posted November 19, 2011 Check their number of steps before this die? Also chicka, that would only work if you link it like this: $randnum = mt_rand(1,1000); //Not sure what numbers it is <a href='steets.php?tresde='$randnum'>Streets</a> You would need to generate that random number first. yes your right... I just took a piece of code from roulette and posted it here to give him some idea as to how to do it.. Quote
Naffer20 Posted November 23, 2011 Author Posted November 23, 2011 Dahm, still not working. I tried with the $_GET['tresde']=abs((int) $_GET['tresde']); if(($_SESSION['tresde'] == $_GET['tresde']) || $_GET['tresde']<20) { die ("Error, you cannot refresh or go back on the streets, please use a side link to go somewhere else. <a href='streets.php?tresde=$tresder'>> Back</a>"); } $_SESSION['tresde']=$_GET['tresde']; Don't work. :( Quote
Curt Posted November 23, 2011 Posted November 23, 2011 I agree with SomeRandomBastard....shouldn't the outcome be based off a random variable ?...that way if a player refreshes the outcome would be random each time... 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.