There are a few ways you could do this
1) The most obvious, redirect to another page which doesn't have the code on it
2) Store a session after the script does its business.
PHP Code:
if( $_SESSION['jobDone'] != true ) {
// your database code
$_SESSION['jobDone'] = true;
}
Needs cookie support on the user's side, unless you fancy passing around the session id.
3) Check the referring page, although - troublesome as some people like to mess with that header (including myself)
Its probably best to redirect to a different page, although - the user can of course hit back which depending on a few factors could indeed set the script going again (in the worst case scenerio). A combination of a different page and sessions can be an effective solution.
Theres a couple of other ways to combat this, but for ease and simplicity I think what I've mentioned are commonly used.
__________________
Classic Gaming for the Next Generation, Please login or register to view this content. Registration is FREE
|