Set session on submit
In the attached file I have tried to set a session variable using the submit button. I want to viewer to enter a promo code once during the session. Why does this fail?
I assume it the placement of the set.
Thanks
Nick
In the attached file I have tried to set a session variable using the submit button. I want to viewer to enter a promo code once during the session. Why does this fail?
I assume it the placement of the set.
Thanks
Nick
the promo code form is set to use the GET method,
change the following code:
<?php
if (!session_id()) session_start();
if(isset($_POST["buttonPromo"])) {
$_SESSION["promoID"] = "".((isset($_GET["promoID"]))?$_GET["promoID"]:"") ."";
}
?>
to:
<?php
if (!session_id()) session_start();
if(isset($_GET["buttonPromo"])) {
$_SESSION["promoID"] = "".((isset($_GET["promoID"]))?$_GET["promoID"]:"") ."";
}
?>
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.