Re: Prevent browser back...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ashley M. Kirchner wrote:
<snip>
I know I can't disable the back button, or clean out someone's browser history, so I'm looking for other ways, server-side perhaps, that I can implement to prevent someone from reloading the upload.php page and try to upload another file (which will generate an error because the Java applet still has the old data in its variables. This is just the way it works.)

Can I rely on referrers on upload.php to see where a hit came from? Or should I redirect to an interim page that simply redirects again to the thankyou.php one (which won't stop someone from hitting back twice, but it's just an extra thing.) What (other) ways have people found that works?

Set a session variable when the upload is done. Check for the existance of this variable before allowing the 'upload' portion of your to execute....


if ( ! isset ( $_SESSION['upload'] ) ) {
	// do your upload stuff
	$_SESSION['upload'] = true;
} else {
	// don't allow it to upload
	echo ( "Sorry, you've already uploaded." );
}

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@xxxxxxxxxxxx

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux