darryncooke
Technical User
Ok so here goes.
I have a form on a contact page that when submits will go to thank you page. However I do not want anyone to be able to access the thank you page unless the form is submitted. I figured the easiest way was to set a session variable on the contact page.
session_start();
$val = "temp";
session_register("val");
and then check and redirect on the thank you page.
session_start();
if (!isset($_SESSION['val']) || $_SESSION['val'] != "temp") {
header ("Location: index.php");
However everytime i go to test the form and submit i get redirected. If there is an easier way to accomplish what I am trying please let me know.
thank you
Darryn Cooke
| The New Orange County Graphic designer and Marketing and Advertising Consultant
| Marketing and Advertising blog
I have a form on a contact page that when submits will go to thank you page. However I do not want anyone to be able to access the thank you page unless the form is submitted. I figured the easiest way was to set a session variable on the contact page.
session_start();
$val = "temp";
session_register("val");
and then check and redirect on the thank you page.
session_start();
if (!isset($_SESSION['val']) || $_SESSION['val'] != "temp") {
header ("Location: index.php");
However everytime i go to test the form and submit i get redirected. If there is an easier way to accomplish what I am trying please let me know.
thank you
Darryn Cooke
| The New Orange County Graphic designer and Marketing and Advertising Consultant
| Marketing and Advertising blog