PDA

View Full Version : url issue


kalidust
23-01-2005, 14:02/02:02PM
I'm not sure what to do to correct this.

If you go to www.ladir.org/gov , the links for the url are like

http://www.ladir.org/gov/leg.php?reg=1&cat=sen

That doesn't validate cuz of the & in the url

so I had changed it to &amps; , however when it goes to the leg.php page, the "cat_print" I have set up - example

if ($reg=="1" && $cat=="sen"){
$cat_print = "Region 1 Senators";
}

elseif ($reg=="1" && $cat=="rep"){
$cat_print = "Region 1 Representatives";
}

elseif ($reg=="2" && $cat=="sen"){
$cat_print = "Region 2 Senators";
}

doesn't display cuz it doesn't match what the url is.

the sql is


$sql_where = ( !empty($cat) ) ? "WHERE title = '$cat' " : "";
$sql_where .= ( !empty($reg) ) ? ( ( !empty($sql_where) ) ? " && (region ='$reg' or region2 = '$reg' or region3 = '$reg') " : "WHERE region ='$reg' " ) : "";
$sql_where .= ( !empty($com) ) ? ( ( !empty($sql_where) ) ? " && (com1 ='$com' OR com2 = '$com') " : "WHERE com1 ='$com' OR com2 = '$com' " ) : "";



Any thoughts on what could be done?

kalidust
23-01-2005, 14:56/02:56PM
Ah, I should not have had the s at the end of
&amps;

Connie
23-01-2005, 16:04/04:04PM
Congratulations! PHP is a foreign language to me. By the way nice new Aviator.

kalidust
23-01-2005, 16:18/04:18PM
Thank you Connie :)