Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.