Reply to Re: [PHP] Prevent browser back...

Your name:

Reply:


Posted by John Nichel on 02/09/05 20:45

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@kegworks.com

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация