I'm assuming you're storing your variables using sessions. After the user has finished everything and is ready for a new form, send a variable along with your session, let's call it $clear, that will flag the next page to erase the variables inside the session.
Example:
$_SESSION["clear"] = true;
the other page with the form should check if that variable is set to true
if (isset($_SESSION["clear"] && $_SESSION["clear"] == true))
{ $_SESSION = array(); }
You DO NOT have to destroy the session. Just clear the variables. You can also be more specific so that you only clear a few variables in the session and not all.
if (isset($_SESSION["clear"] && $_SESSION["clear"] == true))
{
$_SESSION["formField1"] = "";
$_SESSION["formField2"] = "";
// And so on...
}
I use this all the time, except I designate an array variable inside the session that contains all the variables I need for the specific page.
$_SESSION["add_item"] = array($formField1,$formField2);
So, when it comes time to delete, you don't have to worry about other variables. You don't even need to remember what they are called. You will always know that it will be safe to delete that page's specific array variable without losing any other session data.
$_SESSION["add_item"] = array(); // All variables for that page are erased.
I hope this helps.
Rubric