I have a little problem. I have a site that is broken down into cities and then directories under the cities with a naming structure like:
chi_index
chi_key01
chi_key02
chi_key03 etc,
now there possibly could be 20 or so sections per city.
I have a form that has a hidden field set to put certain information depending on what is passed to it. I am using a switch statement, but realized that it could get pretty lengthy if I have to put a statement for each section.
here is a blip of the code:
<?php
switch ($Classified_btn) {
case "santa-fe_index":
echo("<input type=\"hidden\" name=\"subject\" value=\"Free Santa Fe Classified Ad\">");
break;
case "chi%":
echo("<input type=\"hidden\" name=\"subject\" value=\"Free Chicago Classified Ad\">");
break;
case "boston%":
echo("<input type=\"hidden\" name=\"subject\" value=\"Free Boston Classified Ad\">");
break;
?>
What I would like to do is just have one statement for each city like I have here but have the "case" use a wildcard (I think this is what I want) so no matter what section I am coming from it will pass ok, without having to put a statement for each section.
As you can see I tried using % which I know you can in a sql statement.