Reply to unset $_POST variables

Your name:

Reply:


Posted by mtuller on 11/20/07 16:48

I have a page that submits data to a database, and I want to make it
so that if the page is refreshed, it doesn't submit the information
again. I am trying to use unset the variables so that if the page is
refreshed, it will not submit again. I saw a post about setting a time
delay of something like 30 seconds, but would prefer just to unset the
variable. I can't seem to get it working. Here is a snippet of what I
have:

echo 'First Name: '.$_POST['First_Name'];

if (isset($_POST['First_Name']))
{
... if it is set, submit to the database
}
else
{
echo '<h2>There is no data to submit. To enter a nomination, <a
href="index.php">Click Here</a></h2>';
}

unset($_POST['First_Name']);

echo 'First Name: '.$_POST['First_Name'];


The first echo displays what was submitted in the form, the second
shows that the variable is empty. When I refresh though,
$_POST['First_Name'] contains the data from the form again.

Can someone explain how they would go about making sure that when a
page is refreshed that data is not submitted again, or explain to me a
way to get what I have started working?

[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

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