I am trying to verify a session with a unique "key (in this case 303030330303)" from the first page and it needs to be verified by the second page using if.
Page one:
<?php
session_start();
$_SESSION['myValue'] = 303030330303;
?>
Then the second page, is supposed to take this variable (with the "key" 303030330303), match it against the "key" defined on the second page. If it matches, it will echo a success message if not else echo error message.
Page two:
session_start();
if(!empty($_SESSION['myValue'])) {
if($_SESSION['myValue'] == 303030330303) {
echo "Success";
}
}else { echo "Error"; }
This is what I have been fiddling with, but I cannot get it to work. Am a newb so pretty sure am doing lots of things incorrectly.
Any thoughts?
Thanks.