Set session variable to yesok
1 2 3 4 5 6 7 |
<?php session_start(); // store session data $_SESSION["drax"] = "yesok"; ?> |
Check it on next page
1 2 3 4 5 6 7 8 9 10 11 12 |
<?php session_start(); if($_SESSION['drax'] == 'yesok') { // your variable equals 'yes' do something } if($_SESSION['drax'] != 'yesok') { // your variable does not equal 'yes' do something } ?> |
Else do a redirect and add this to the top
1 2 3 4 5 6 7 8 9 |
<?php if($_SESSION['drax']!= 'yes'){ header("Location: index.php"); } else { header("Location: xxx.php"); } ?> |