I am trying to capture and store the value of a sort parameter as one hops
around various web pages. When they get back to main page, I want the data
from a database to be sorted the same way as the left it.
I was thinking to use cookies to retain the sort value, but it is not
working as I would expect. Another problem is that all the documentation I
find is either too old or too new for my version (PHP Version 4.3.4).
Here is what I have tried, but it is not working.
<?php
session_start() ;
if (empty($sort_ke y)) {
setcookie("sort _key","est_star t");
}
?>
<HTML>
<BODY>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
</HEAD>
<?php
$sort_key = $_POST['sort'];
$_SESSION["sort_key"] = $sort_key;
$sort_key = $_SESSION['sort_key'];
if (empty($sort_ke y)) {
$sort_key="est_ start";
}
around various web pages. When they get back to main page, I want the data
from a database to be sorted the same way as the left it.
I was thinking to use cookies to retain the sort value, but it is not
working as I would expect. Another problem is that all the documentation I
find is either too old or too new for my version (PHP Version 4.3.4).
Here is what I have tried, but it is not working.
<?php
session_start() ;
if (empty($sort_ke y)) {
setcookie("sort _key","est_star t");
}
?>
<HTML>
<BODY>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
</HEAD>
<?php
$sort_key = $_POST['sort'];
$_SESSION["sort_key"] = $sort_key;
$sort_key = $_SESSION['sort_key'];
if (empty($sort_ke y)) {
$sort_key="est_ start";
}
Comment