Jump to content

Form Search Problem


livingwells

Recommended Posts

I am a newbie to PHP and have taken over a website that has a form search field that has never worked.

Here is the code from with-in the form on the displayed page: (It actually does display a list of cities which to choose from in the dropdown)

The problem is, once a city is selected and you click the "submit" button, the results show the entire tbl_listing, not just entries from the selected city.

 

!-- BEGIN: city_select -->

<SELECT id="city" name="city" style="width:170px">

<OPTION value="0" selected>Select City/Town</OPTION>

<!-- BEGIN: city_option -->

<OPTION value="{option_city}">{option_city}</OPTION>

<!-- END: city_option -->

</SELECT>

<!-- END: city_select -->

 

Here is the code on the processing page:

 

$strSQL="select DISTINCT(city) as cityy from tbl_listing order by cityy";

$rsCity=mysql_query($strSQL);

while($rowCity=mysql_fetch_array($rsCity)){

$xtpl->assign('option_city', $rowCity["cityy"]);

$xtpl->parse('main.city_select.city_option');

}

 

 

Any help or suggestions would be appreciated greatly!

Thanks

Link to comment
https://forums.phpfreaks.com/topic/122392-form-search-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.