Scott Fletcher <mailto:[EMAIL PROTECTED]>
    on Friday, February 20, 2004 8:41 AM said:

>     Went Google surfing on Browser Refresh & Back/Forward Button and
> it turned out that PHP can do the dirty work.  Problem is no sample
> script, all I see are comments about suggesting on using the
> $_SESSION or the database to check the $_POST stuffs and do something
> about it.

What the heck are you talking about and why is "Browser Refresh &
Back/Forward Button" capitalized? Is that the name of a band or
something???

> So does anyone know of a good sample code to help this out?  Like
> classes or something because manually writing it on 20+ webpages is a
> haunting task for the billing stuffs I had already developed for 6
> months.

Well first of all you shouldn't be writing the same code over and over
in a page. If you find yourself needing the same code on multiple pages
that's where includes come in. You write the functions or code snippets
necessary to get the job done and then you include it on each page.

<?php

  include "fancy_stuff.php";

?>

> Beside I don't really have an concept of writing a good
> "Refresh/Back/Forward" detections script.

Are you trying to process a form a something and you want to prevent the
browser from processing the form when the user clicks the back button?

If that's the case I have a solution for you. The way I get around this
is to have two separate pages that display and process the form. The
first page displays the form and the second page processes it. When the
second page is done processing the form it will redirect the user to
wherever they need to go next.

The second page never becomes a part of the browsers history so the user
can click the back/refresh buttons all they want and the form will not
be processed more than you want it to be. Actually that's not totally
true because the user could go back and resubmit the form.



hth,
Chris.

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

Reply via email to