I have some code which includes a link to another page. What I'd like to do is set the $_SESSION value for two values upon clicking of the link.
I've created a hidden field within the link to establish the value, now its just a question of being able to set the values when the user clicks on the link.
Here's a snippet of the code to see...
Code: Select all
<?php
<form action="<?=$_SERVER['PHP_SELF'];?>" name="frm_section" method="post"><table width="800px" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<a href="aboutav.php<?php if( !empty($_POST['section']) ) { $_SESSION['section'] = $_POST['section']; $_SESSION['page'] = $_POST['section']; } echo (!empty($_SESSION['section']) ? '?section='.$_SESSION['section'] : '' ) ?>"><input name="section" type="hidden" value="aboutav"><img src="images/aboutus.gif" border="0" /></a>
</td>
</tr>
</table>
</form>
?>$_SESSION['section'] = $_POST['section']
$_SESSION['page'] = $_POST['section']
These variables will be changing based on the links that the user selects. it will never be empty as I'm setting the values when the user comes to the site.
Yes - I know both are using the same $_POST value - that's okay. That's what I need them to do.
The PHP code embedded within the link was provided to me by someone on another thread - but it doesn't seem to be working.
Can someone far more intelligent than myself (which is probably anyone on this list!) please help me out here? I'm stuck! THANKS SO MUCH!!!!