Reply to Re: [PHP] How to unset a post variable

Your name:

Reply:


Posted by Richard Lynch on 04/19/05 06:25

On Fri, April 15, 2005 5:08 am, Mario de Frutos Dieguez said:
> I have another little question hehe :D, i have a page with a form where
> the user insert data and can click in a new,edit or delete button. I've
> make that when a button is clicked the page refresh and in the head of
> the page i have conditions like this: if ($_POSt["buttonNew"]!="") {
> insert commands.. } , etc
>
> My question is, how can i unset $_POST["buttonNew"] or leave it empty
> because when the user refresh the page make insert commans again because
> the $_POST["buttonNew"] arent empty.

The POST data is sent by the browser, so you can't really alter that...

But you can bury an http://php.net/md5 or other random token in the FORM,
and put that token in a table in your database, and then on the first
POST, you mark that token as "used"

On the second POST, a re-load, you can detect that the token was "used"
and do whatever you want. Re-direct the user, ignore them completely,
give them an error message, blow up their computer. Well, okay, you can
do almost whatever you want.

--
Like Music?
http://l-i-e.com/artists.htm

[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

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