Javascript popup with PHP Session
Simple to detect whether user is 1st time enter the website, the code below are example working code
if ($_SESSION['SID']['pop'] == '' || $_SESSION['SID']['pop'] == 0) echo 'window.onload=alert("Test, 1 popup for 1 session. By s4femod3")';Everytime user refreshed the page the value $_SESSION['SID']['pop'] will increase by 1.
$_SESSION['SID']['pop'] += 1;
echo 'window.onload=alert("Test, 1 popup for 1 session. Current session val :'.$_SESSION['SID']['pop'].'")';
0 Comments:
Post a Comment
<< Home