[thelist] deleting php vars

jan guichelaar [artmiks] jan at artmiks.nl
Thu Oct 30 09:43:33 CST 2003


thanx Simon,
really helpfull

jan

jan at artmiks.nl

====================
Artmiks [image builders]
http://www.artmiks.nl
====================
recent projects
http://www.kluun.nl
http://www.marryyourpet.com
http://www.wereldpost.nl
http://www.margeting.nl
====================
----- Original Message -----
From: "Simon Perry" <simon.perry at si-designs.co.uk>
To: <thelist at lists.evolt.org>
Sent: Thursday, October 30, 2003 3:29 PM
Subject: Re: [thelist] deleting php vars


> ----- Original Message -----
> From: "jan guichelaar [artmiks]"
> > Hello all,
> >
> > I have a quostion about php.
> > I made a cms with php and mySQL.
> > With a form i post/get some vars to a php-page. In this page i put the
> > posted vars into de dbase.
> > Now my problem is, when people press the 'refresh' button on their
> browser,
> > the php-page puts the vars again into the dbase.
> >
> > Is it possible for php to 'forget' the vars it gets from the previous
page
> > through a post/get  method?
> >
> Jan,
>
> Depends on your page flow but the trick I usually use is to reload the
page
> after a successful insertion, sending first a [1] HTTP 205 header and then
> the page location without any appended vars (or at least only the ones you
> still want). If you are using sessions remember to unset() and
> session_unregister() any posted vars that may have been saved.
>
> if ($dbInsert=="insert went ok"){
>     header("Status:  205 Reset Content");
>     header("Location: original-page.php");
> }
>
> Simon
>
> [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
>
> --
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>
>



More information about the thelist mailing list