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:
Bir Baskı bazı listesi için ne kullanıcı arama searctest.php ve isterlerse, veritabanına gönderebilirsiniz içinde.
include("searchtest.php");
I yeniden, ya sayfasını kapatın, sonra çerez son açık DIV etiketi konaklama açıldı, iyi çalışır. Ama kullanıcı sonra bir arama yapmak ve bunu POST, sonra çerez değişken boşaltacaktır.
Nasıl ben bu atlayabilir bana bir şey önerebilir misiniz?