if (isset($_COOKIE["pagelimit"])) {
$pagelimit = $_COOKIE["pagelimit"];
}else{
setcookie("pagelimit","", 1);
setcookie ("pagelimit", "10");
$pagelimit = $_COOKIE["pagelimit"];
}
// set number of results to display per page
if(isset($Submit)){
//start if
setcookie("pagelimit","", 1);
$pagelimit = $_REQUEST['pagelimit'];
setcookie ("pagelimit", "$pagelimit");
$pagelimit = $_COOKIE["pagelimit"];
//end if
}
there's the php code i'm attemping to use to make it store the pagelimit on my pageination script. The form they use to fill in how many they want shown is below
<form name="Go" method="post" action="<?=$pagename?>"><td valign="middle" class="newlayout"><div align="left">
<strong>show per page:</strong>
<input name="pagelimit" type="text" class="bars" id="pagelimit" value="<?=$pagelimit?>" size="5" maxlength="3">
<input name="Submit" type="submit" class="bars"value="Go">
</div></td></form>
I've probably went around this the wrong way like but if anyone wants to help then please do because I just can't get the hang of using cookies