Session fails to return entry to form on error [SOLVED]
Posted: Tue Apr 22, 2008 8:10 am
Having a few issues with the Session capabilities at the moment.
I've got a PHP based form that once submitted goes to a seconday page where the validation and email submittion is completed. I'm trying to add the session capability so that if an error is discovered during the validation, it will re-direct back to the PHP form, indicate the specific error via a case and also re-add the submitter entries so they don't need to re-type the correct information...
On my PHP form page, I do have the session command as the first action within the body.
Then on my PHP email handle page, the first php codes are related to my session.
Now, for my validation / error redirect it's coded in the following fashion.
The error case does still display after the addition of the session handling, but my original entries are not re-entered automatically within my form text fields. Any ideas?
I've got a PHP based form that once submitted goes to a seconday page where the validation and email submittion is completed. I'm trying to add the session capability so that if an error is discovered during the validation, it will re-direct back to the PHP form, indicate the specific error via a case and also re-add the submitter entries so they don't need to re-type the correct information...
On my PHP form page, I do have the session command as the first action within the body.
Code: Select all
<?php session_start(); ?>
Code: Select all
<?php
//************************************************
//PHP Cookie Information
session_start();
session_register ("name");
session_register ("email");
session_register ("business");
session_register ("acct");
session_register ("username");
$HTTP_SESSION_VARS ['name'] = $_POST["name"]
$HTTP_SESSION_VARS ['email'] = $_POST["email"]
$HTTP_SESSION_VARS ['business'] = $_POST["business"]
$HTTP_SESSION_VARS ['acct'] = $_POST["acct"]
$HTTP_SESSION_VARS ['username'] = $_POST["username"]
Code: Select all
if (empty($_POST["name"]) || empty($_POST["email"]) || empty($_POST["business"]))
{
// redirect back to form
header ("Location: ../form.php?error=info");
exit();
}