I have a php page that I created a login for it uses a jquery drop down to show the form that displays the login and I am trying to fix it to work also if js is disabled. Right now it is set so that if java script is enabled and you click on a link (href="#") then the box drops down. However if js is disbaled i need that link to instead show (href="login.php").
My thought was to check if javascript is enabled by setting a cookie and then php will just check if that cookie is created. So i go and set my cookie using:
<?php if(isset($_COOKIE['JsCheck'])){ die('JS Enabled');//The die is just here for testing purposes } ?>
First I make sure that the cookie is not set and then with js enabled on my browser I go to my page. Once loaded I check my cookies and firefox reports back to me that my cookie was successfully created. However my php check did not trigger and kill the loading of the page. Once that is done though if I go and reload the page with the cookie already set php picks up the cookie and kills the refresh.
Is there a reason why this check does not work upon the initial loading when the cookie is set?