i want to destroy a $_POST['some variable'] in my code..
i used unset(); function for that but it is not working....
my problems is
first of all i sent a variable(some x in sample.php) to next page(xyz.php) in that page i need that variable($x) for inserting a data..after inserting i press F5 it is again inserted into the database..
so i want to unset that variable($x) in xyz.php page....
can anybody help me in that case..
and also i need to block page refreshing script
how to unset a post variable
Moderator: General Moderators
-
kushaljutta
- Forum Commoner
- Posts: 50
- Joined: Fri Dec 26, 2008 11:05 am
Re: how to unset a post variable
every time you refresh the page, the $_POST array will repopulate. The best solution to your issue is to redirect back to the page using header() or some other redirection method so the $_POST array gets dumped.
look how phpBB does it when you post a message. It takes you to a page (where data is posted) then redirects you back to the thread....
look how phpBB does it when you post a message. It takes you to a page (where data is posted) then redirects you back to the thread....