Forum Moderators: coopster
I'd like a form with four questions to appear on each page of my web site, but only once per page. At the moment, if someone visits a page twice they get a questionnaire about it again.
Is the a way to use PHP sessions to remember not to display the form if it has already been used?
Any suggestions most welcome.
Thank you in advance,
Ed
if
(isset(S_POST['aaaa']) &&!empty(S_POST['aaaa']) )
However, I don't need them to register $usr, I just want it to check if a session hasn't been opened, display the form. If it has, don't display it, and carry the session to the next page.
<?php
session_start();
// CHECK IF SESSION EXISTS.
if (!isset($_SESSION['usr'])) {
// IF NO, THEN CHECK FOR COOKIE
if (isset($_COOKIE['usr'])) {
// IF 'YES' THEN START SESSION
$_SESSION['usr'] = $_COOKIE['usr'];
}
// IF 'YES' THEN QUIT }
else {
// IF THE SESSION EXISTS, MAKE SURE [EMAIL PROTECTED] VALUE MATCHES THAT OF THE COOKIE
setcookie("usr", $_SESSION['usr'], mktime(21,00,0,12,31,2014),"/","bigbarn0.kbnet.net", 0);
// END
}
?>
Any help would be most welcome
Thanks