Hi I’m trying to use a session variable in my php script.
Every page starts with
[code=php]<?php include(‘include/header-section.php’)?>
which starts:
[CODE]
<?php session_start(); ?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”><html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en-GB”>
<head>
Every page has
[code=php]<?php include(‘include/menu.php’) ?>
which includes this link for a contact form:
[code=html]
<li class=”accordionButton”><a class=”rfpMenuBtn” href=”contactform.php?id=1″
<?php $_SESSION[‘contactform_id’]=1 ?> >Contact us</a></li>
Every page has
[code=php]<?php include(‘include/footer.php’); ?>
which contains links to the same contact form
[code=html]
<div class=”push”></div>
<div class=”footer”>
<div style=”width: 23%; float: left;”>Moshe Avni – Art Work.</div>
<div style=”width: 53%;text-align: center; float: left;”>
<a href=”contactform.php?id=2″
<?php $_SESSION[‘contactform_id’]=2 ?> >Rahel Warshaw-Dadon – Reiki Master. Email: [email protected]</a>
</div>
<div style=”width: 23%; float: right; text-align: right;”>
<a href=”contactform.php?id=3″
<?php $_SESSION[‘contactform_id’]=3 ?>>David Myers – Web Master.</a>
</div>
</div>
contactform.php also includes menu.php and footer.php if that’s relevant.
The problem is I cannot change the value of $_SESSION[‘contactform_id’], it is always the value that’s set in menu.php (1), and clicking on links in footer.php (2 or 3) do not change the value.
Sorry about including all this code but I have no idea where the problem is.
Thanks for any help
David
“paddling upstream searching for the source”