form variables stored?
-
Hi: I am trying to do soemthing which i think is simple; but I am missing something crucial I think…
I have an email capture form on a landing page; a simple php form which goes to a page and dumps inputs into “post” variables. I saved the variables into session variables thinking then they would be saved while moving from file back to the site. here is the whole sequence:
on input page have this form:
/********/
<form action=”gform1.php” method=”post”>
<p>Your First Name: <input type=”text” name=”firstname” />E-mail: <input type=”text” name=”email” /></p>
<input type=”image” name=”btn_opentextbox” src=”http://privatelabel.gtdsites.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-12-at-4.43.40-PM.png” value=”Submit” />
</form>
/********/then we go to the file:
/*********/
<?php session_start();$_SESSION[‘firstanme’] = $_POST[‘firstname’];
$_SESSION[’email’] = $_POST[’email’];?>
<?php
header( ‘Location: http://privatelabel.gtdsites.com/form-landing’ ) ;
?>
<html>
<body>Thank you for filling out our form, we will be in touch with you shortly.
Your name is: <?php echo $_SESSION[‘firstanme’]; ?>
Your e-mail: <?php echo $_SESSION[’email’]; ?></body>
</html>
/********/NOw I know the variables are stored in the session variables because i had different code in there and at least while still in this file; the session variables were stored; and i could display them or whatever; but when i go to that landing page the session variable values are lost;
so I think I am missing something crucial here; and is that session variable just cannot be retained when going from the file back to my site?
I am confident that i can save them in a mySQL database and probably do that straight from the file; but that seems a bit extreme and seems overkill to me…
so – does anyone know better? how to retain these variables while going from that file back to the site?
thanks! G
The topic ‘form variables stored?’ is closed to new replies.