Prevent Refresh

Forum
Last Post
Threads / Messages

PTGigi

Crazily Friendly~HoF
Premium Member
Joined
Jul 17, 2009
Messages
363
Points
0
Age
29
Location
Somewhere >.>
Mysidian Dollar
15,125
Okay so I wasn't sure if this was a question or a suggestion so I'll throw it out.


I'm in the middle of coding something and REALLY need a way to disable refreshing, basically I don't want cheaters. (because I have a page that gives you an adoptable but I do not want you to get it twice through refresh, I suppose this could also be added to the 'congrats you've adopted ___" page but really I'd like it if someone could help out XD

I assume there isn't an exact way to do this since it involves messing with people's browsers. But is it possible to make a pop-up message when you hit F5 or refresh appear and say 'refreshing disabled' or whatnot? Or somehow make a way to remove the given adoptable if you refresh the page?

Anymore ideas or suggestions or anyone know of a way to do this? o_O Javascript will also work though all my Google searching only disheartened me (apparently this technique is mainly used by scam and porn sites T_T)

EDIT: Mrf, just thought of something else.

Is it possible (I've been trying but failing) to make some sort of variable that adds up as you visit the page? Sorta like the log-in attempts on forums?
 
Last edited:
Well, about the refresh thing... It's pretty much impossible (as of what i've read on it) and For the attempts thing... use a session or a cookie... (cookies you can clear/edit so I suggest using a session) There easier then they look... mostly
 
Yeah, you will have to use sessions. They are rather complicated to implement though, ask a PHP coder for help if you want to.
 
Another possibility is using a redirect. It takes you away from the page that you don't want to be refreshed immediately, and even if you back up it should still redirect you. Then again Javascript can be disabled so... ^.^ You'd have to have some pretty dedicated cheaters. But Sessions work too, they're just more complex.
 
I was thinking about that XD Lol I'm probably over thinking this as well XD I don't know how many users think 'refesh!' XD But thanks anyway guys :D I'll probably end up doing the redirect (since I was planning on that for another page anyway :meow:)
 
If you're worried that the users have javascript disabled, then use the PHP header function to do the redirection
and session isn't really that hard to implement actually...
 
yes fadillz is right you can simply use

header("Location: page.php");
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,119
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top