I'm currently working on a site where I'm trying to make use of the session variables.
I have a controller script (index.php) that begins with session_start();
and has two different HTML files included within if
statements. Everything works all groovy when I go to /quote/index.php
, the session variables that I've set are echoed on the page as expected, however if I remove 'index.php
*' from the URL so it points to just /quote
the page loads however none of the session variables show up.
I'm not using session_destroy
anywhere in my scripts and the session variables aren't echoing '0
' so I'm fairly sure they aren't being unset, it seems as though they are just ignored without the filename in the URL!
Any insight as to why this is occuring would be awesome, Thanks
/quote/index.php (with extraneous bits removed):
<?php
session_start();
if (isset($_GET['form']))
{
include 'form.html.php';
exit();
}
if (isset($_GET['fetchquote']))
{
$width = mysqli_real_escape_string($link, $_POST['width']);
$height = mysqli_real_escape_string($link, $_POST['height']);
$_SESSION['height'] = $height;
$_SESSION['width'] = $width;
}
include 'quote.html.php';
?>
The session variables are echoed in quote.html.php