PHP session with javascript value set?

~( Da3kariS )~

New member
i have a PHP page and i have added a form, the form contain javascript function which reload the form to set a value in a list, but when i reload the form the session destroyed.

<script language=JavaScript>
function reload(form)
{
var val=form.cat.options[form.cat.options.selectedIndex].value;
self.location='register.php'+'?cat=' + val ;
}

</script>

the form has 2 lists "categories" and "sub_categories", when i choose the category 1 for example the sub_category will show only the items that belong to the category number 1.
the javascript code is working so far, but when i reload the page the session is gone, what should i do to keep the session and the value of the category?
the point is, when the JavaScript reload the form, the session will be ignored and the page goes to the original page. am using WAMP server (localhost), because when i reload the form the page will be i.e: "register.php?cat=313" so the session is gone.
please help
 
Back
Top