Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-29-2009, 02:26 AM   #1
Registered: Feb 2009
Posts: 119

Rep: Reputation: 16
Suggest a PHP snippet for 2/3 tier menu


I'm looking for a simple php snippet or jquery example that would implement a 2 or maybe 3 tier navigation menu from an array. I've looked about the net but many of them seem insecure ie liberal use of the $_GET tag

Something like:


Clicking on cats would take you to a page with siamese manx....
Clicking on Dogs would take you to Pedigree Mongrel then on to corgi, alsation..

Better to ask first than be sorry later!

Thanks in advance good folks...


Last edited by ludo33; 11-29-2009 at 02:37 AM.
Old 11-30-2009, 11:18 AM   #2
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 97
What is it that you perceive as insecure about the use of the $_GET array?

If it is being used to change the state of the server (e.g. inserting data into a database), then that is not a good idea. However, if it is being used to select what content to display and/or how to display it, then, as I see it, this is exactly what $_GET is for.

The advantages of using the $_GET array are simplicity, and that a static URL is automatically provided to the user (e.g., allowing them to link to / bookmark the page. The exception might be a page that you do not want someone to be able to go to directly (e.g. one requiring login). Using it for indicating what menu/submenu to display isn't much different, IMHO (.../page.php?cat=cat&subcat=siamese).

Last edited by Robhogg; 11-30-2009 at 11:57 AM. Reason: Clarification
1 members found this post helpful.
Old 12-01-2009, 04:34 AM   #3
Registered: Feb 2009
Posts: 119

Original Poster
Rep: Reputation: 16

For you reply, I have read a lot about incorrect use of $_GET and the dangers held within. Now, thanks to your reply I now know why!

Siamese cats here I come!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
suggest software for full screen menu/launcher technononsense Linux - Software 3 08-17-2009 07:40 AM
1 tier cluster with HA and load balancing red_coder Linux - Server 3 04-10-2008 01:29 AM
Emacs smart-snippet rejeep Linux - Desktop 0 02-06-2008 01:54 PM
LXer: osCommerce is first class for second-tier toy retailer LXer Syndicated Linux News 0 10-21-2006 01:03 AM
calendar-related code snippet request Citizen Bleys Programming 2 12-11-2001 12:11 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:50 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration