Page 1 of 1

PHP Or? (alternate navigation)

Posted: Fri Feb 17, 2012 2:02 pm
by Xsis
Hi guys,

I'm almost finished with the base layout for my website, and now comes the question, I'm currently using AJAX for my navigation to get a non-total-refresh of site content.
but I know that some people don't have javascript / java enabled on their pc's (example my job computer..).
So I was thinking, can you give me an advice on how I can create a PHP code that checks for if there's javascript enabled <noscript>, and if it's true it should load a normal PHP navigation. if not true, then load AJAX Navigation ?


I don't want an actually script, just hints of what I need to use in code.

And the other part is, how can I create a safe navigation in PHP?

I know there's the $GET function, but I've heard it's unsafe to use this. So anybody a heads up on how to create a PHP Navi with a secure check?

Re: PHP Or? (alternate navigation)

Posted: Fri Feb 17, 2012 2:26 pm
by xtiano77
You can use the “<noscript>” tag, which will simplify things, or the Cookie route with JavaScript. Basically, the no “<noscript>” tag will show the code contained within it if the client scripting languages are not enabled. On the other hand, you can setup a JavaScript function which in turn will setup a cookie, then PHP can search for that cookie and if it exists and the values within are correct then the AJAX menu will show, otherwise the HTML menu will.