Hi Gods!
main.php:
<div id="test" class="test">
<?php include("data.php");?>
</div>
data.php: In this php, i have a few query, and then print some list...Each list in an own DIV tag, and all DIV tag is "closed" when the page is load, except the last one that the user opened. I use cookie to save the the DIV ID to know which i have to open when the page is reload.
JS PART:
var test= $.cookie('test_cook');
$('div[class*="test"]').hide();
var op = $.cookie("test_cook");
alert(op);
$('div.test' + op).show();
$('input:image').click( function() {
var nr = $(this).attr('id').substr(7,2);
$('div.test' + nr).toggle(400);
$.cookie("test", nr, {expires:1 });
});
PHP PART:
In searctest.php a print some list what the user search for, and if they want, can send to database.
include("searchtest.php");
If i reload, or close the page, then cookie is works well, the last opened DIV tag stay open. But after user make a search, and POST it, then the cookie variable will empty.
Could you suggest me something how can i bypass this?