View Full Version : breadcrumb through a href variables

03-15-2009, 05:40 AM
ok heres my problem
I have 2 differnt sets of links each with vairiable included
menu 1

<a href=USA.php?state = texas> TEXAS </a>
<a href=USA.php?state = california> CALIFORNIA </a>

Menu 2

< a href=USA.php?service = church> Churches </a>
< a href=USA.php?service = hospital> Hospitals </a>

when the first menu is clicked on it only dispalys the state but when the second menu is clicked on it displays both the sate and the service displaying it in the same manner as the breadcrumb trail at the top of this page "Board index Programming PHP - Code". Can anyone PLEASE help me to figure this one out? Im using SWITCH at the moment and can get one or the other menu to display its location but not both. Grrr Im going out of my head

03-15-2009, 01:29 PM
I think the easy way is to add the first parameter along with the second set of links like

<a href="USA.php?state=texas&service=church"> Churches </a>
<a href="USA.php?state=texas&service=hospital"> Hospitals </a> then write a condition in the USA.php page to check the value of variable state and then echo the required link. It's not a foolproof method as when some one edit the url from the address bar, s/he won't get that advantage. :)