On pressing the submit(image button) - i go to B.php where i convert all the post values to session using --
Code: Select all
if(isset($_POST))
{
foreach($_POST as $key => $value)
{
$_SESSION["key"] = $value;
}
}
currentPage
Submit_x
Submit_y
Submit
Submitted
submitted etc
n then i have a problem while am inserting data to the database as field doesn't exist in database then.
So i have to unset each of the unwanted session before inserting the data like -
Code: Select all
unset($_SESSION['currentPage']);
Code: Select all
if (!isset($_SESSION['country']))
{
$_SESSION['country'] = $_POST['country']
}
I thought once you have a form and you start a session and convert all the post values to session - it exist till you destroy the session at the end of the last page.
Please let me know how can i improve sessions or am i doing it right ?
Thanks