PHP Or? (alternate navigation)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Xsis
Forum Newbie
Posts: 10
Joined: Tue Feb 07, 2012 10:38 am

PHP Or? (alternate navigation)

Post 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?
xtiano77
Forum Commoner
Posts: 72
Joined: Tue Sep 22, 2009 10:53 am
Location: Texas

Re: PHP Or? (alternate navigation)

Post 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.
Post Reply