In order to pass a variable between 2 .php files I used,
sender
<?php
session_id('theSessionID');
session_start();
$_SESSION['theLOG'] = $theloginusername;
?>
receiver
<?php
session_id('theSessionID');
session_start();
$theloginusername = $_SESSION['theLOG'];
?>
(BTW it only worked with the session_id)
and it worked but I noticed that on other pages which incorporated this code,
<?php
if (empty($_GET)) {echo "<script>window.location = 'http://www.myweb.com/'</script>";}
$passToken = $_GET["recordID"];
?>
that the above conditional acted as if the variable was empty even when it was not.
Strangely, when I commented out the conditional statement the $passtoken
variable was assigned the expected value from $_GET
.
Why is it that when I use $_SESSION
that $_GET
responds in this way?