hello guys, just wondering can someone help me on this, plz.
I have a form, whereby after u submit it will link to another form and so on. Then it will generate an email to the user. I know u need to use session. So i did. There something wrong at the code below, can;t figure out where. What i m trying to do its to make the name field from the form page to be the session variable name in the session.
FORM.HTML
<form action="action.php" metho="post">
<input type="text" name="Name">
<input type="text" name="Country">
<input type="text" name="Telephone">
<input type="submit" name="Submit" value="Submit">
<form>
Assuming on the FORM.HTML. I entered Name=Bill, Country=China, Telephone=99999. I do know that u can register the variable to session manually but how do i automate it?...
ACTION.PHP
foreach($HTTP_POST_VARS as $key => $value)
{
session_register("$$key");
}
echo $_SESSION["Name"]; //suppose to show BILL
So let say i some expert out there manage to solve the problem above. How do i reverse the process now. I mean like taking making the session name as the variable name.
foreach($HTTP_SESSION_VARS as $key => $value)
{
echo $key
}
I need it be when i echo $Name, $Country, $Telephone it would show me the value of it. If that can't be done, Is there any other way that i can allow the user to receive when i generate the email as follows
Name : Bill
Country : China
Telephone : 999
Your help is much appreciated. Thanks