I'm having big problems with passing a variable from one page to another. I have file (index.php) that sets a few variables then links via include() to an another file (layout.php). What I am having trouble is passing the varible onto the layout page as it says no variable has been set when I turn on the error reporting. I have tried turning on 'register_globals' in ini_set and tried using the $_GET['variable_name'] but it still errors.
In index.php ...
<?php
$variable_name = variable_string;
// and other variables ...
include (layout.php');
?>
In layout.php ...
<?php
ini_set ('register_globals', 1);
$variable_one = $_GET['variable_name'];
print ($variable_one);
// and other variables ...
?>
Can you please help me (by showing me a relevant link or providing a solution) with this terrible problem? Thanks in advance for any support.
In index.php ...
<?php
$variable_name = variable_string;
// and other variables ...
include (layout.php');
?>
In layout.php ...
<?php
ini_set ('register_globals', 1);
$variable_one = $_GET['variable_name'];
print ($variable_one);
// and other variables ...
?>
Can you please help me (by showing me a relevant link or providing a solution) with this terrible problem? Thanks in advance for any support.