Posted by Janwillem Borleffs on 02/27/06 00:32
sunnyboy@europe.com wrote:
> Any ideas why this is not working and how I could do it?
>
You are making the mistake to mix client side (javascript) and server side
(PHP). Consider the following revision:
<?php
session_start();
if (isset($_GET['cat'])) {
$_SESSION['cat'] = $_GET['cat'];
}
print isset($_SESSION['cat']) ? "cat is {$_SESSION['cat']}" : 'cat is not
set<br />';
?>
<a href="index.php?cat=1">Set cat to1</a>
<a href="index.php?cat=2">Set cat to 2</a>
JW
Navigation:
[Reply to this message]
|