How to clear variables?

From: Date: Thu, 21 Mar 2002 14:40:40 +0000
Subject: How to clear variables?
Groups: php.general 
Request: Send a blank email to php-general+get-89504@lists.php.net to get a copy of this message
Hi everybody, I am having a problem with variables. Basically I have not found a way to clear them so they are reset to "" if the user reload the page or move to another page Here is the speudo code: >?php session_start(); If ($Faction=="Add to Data") { Add_to_data(); } <html>... <form...method="POST" action='this_script?with session_id()'> .. <input...> <input type='submit' name=Faction value='Add to Data'> </form> <?PHP function Add_to_data() { Add data to mysql DB session_unregister('Faction'); session_destroy; } ?> The above speudo script work fine and when the user click 'Add to Data', the data is added to my database. Howver, the session_unregister and session_destroy do not clear the variable Faction and its value. Therefore if the user click Reload on the browser, the data gets added again. What is my problem, Thanks in advance Claude

« previous php.general (#89504) next »