Search Problem

5 posts by 3 authors in: Forums > CMS Builder
Last Post: February 25, 2009   (RSS)

Re: [blind2uriz] Search Problem

By Kenny - February 24, 2009

I'm not sure where you are going wrong, but here is a form you can use that works. Maybe you can figure out what you are missing from this:

<form method=POST action="form.php">
<b><font face="Helvetica" color="#000066">Search Residential Property Listings</font></b></p>


<table border=0 cellspacing=3 cellpadding=3 id="table4">
<tr>
<td bgcolor="#FFFFFF">

<table border=0 cellspacing=3 cellpadding=3 id="table5">
<tr>
<td><font face="arial" size=2>&nbsp;Price </font></td>
<td>
<select name="price_min">
<option value="">Minimum</option>
<option value="">Any</option>
<option value="0">$0</option>
<option value="50000">$50,000</option>
<option value="75000">$75,000</option>
<option value="100000">$100,000</option>
<option value="125000">$125,000</option>
<option value="150000">$150,000</option>
<option value="175000">$175,000</option>
<option value="200000">$200,000</option>
<option value="250000">$250,000</option>
<option value="500000">$500,000</option>
</select>
&nbsp;
<select name="price_max">
<option value="">Maximum</option>
<option value="">Unlimited</option>
<option value="50000">$50,000</option>
<option value="75000">$75,000</option>
<option value="100000">$100,000</option>
<option value="125000">$125,000</option>
<option value="150000">$150,000</option>
<option value="175000">$175,000</option>
<option value="200000">$200,000</option>
<option value="250000">$250,000</option>
<option value="500000">$500,000</option>
<option value="1000000">$1,000,000</option>
<option value="2000000">$2,000,000</option>
</select>
</td>
</tr>
<tr>
<td><font face="arial" size=2>&nbsp;Bedrooms&nbsp;</font></td>
<td>
<select name="bedrooms_min">
<option value="">Minimum</option>
<option value="">Any</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
&nbsp;
<select name="bedrooms_max">
<option value="">Maximum</option>
<option value="">Unlimited</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
</td>
</tr>
<tr>
<td><font face="arial" size=2>&nbsp;Bathrooms&nbsp;&nbsp;</font></td>
<td>
<select name="bathrooms_min">
<option value="">Minimum</option>
<option value="">Any</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
&nbsp;
<select name="bathrooms_max">
<option value="">Maximum</option>
<option value="">Unlimited</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
</td>
</tr>
<tr>
<td><font size=2 face="arial">&nbsp;Type </font></td>
<td>
<select name="property_type_keyword" size="1">
<option value="">Any</option>
<option value="Home">Home</option>
<option value="Condos">Condos</option>
<option value="Townhouse">Townhouse</option>
<option value="Apartments">Apartments</option>
<option value="Mobile Homes">Mobile Homes</option>
<option value="Lot">Lot</option>
<option value="Acreage">Acreage</option>
<option value="Duplex">Duplex</option>
<option value="Triplex">Triplex</option>
<option value="Farm or Ranch">Farm or Ranch</option>
<option value="Other">Other</option>
</select>
</td>
</tr>
</table>

<p>
<div align=center>
<input type=submit name="search" value=" Search Listings ">
</div>

</td>
</tr>
</table>
</form>


Let me know if it isn't working for you.

Kenny

Re: [blind2uriz] Search Problem

By Dave - February 24, 2009

Hi John,

A couple more tips to help debug this.

Change your form from POST to GET: <form id="form1" name="form1" method="GET" action="http://www.idsitepreview.com/listingList.php">

This will make all the search criteria show up in the url where you can more easily see (and modify or test) what is being submitted. You can change it back later when it's working if you like.

Enter numeric searches as whole numbers without extra characters. For example, change this: <option>$100,000</option> to this: <option value="100000">$100,000</option> otherwise the numeric searches won't work properly.

Next, if you're passing sort order directly to mysql make sure you're escaping it or it could make the page insecure.

Try those changes and if you're still having troubles attach your viewer file and we can take a look.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Search Problem

Thanks for the form example sagentic, it works great!

Thanks for the reply Dave and your information as well, but I'm confused on what you mean about sorting. How do I escape it? I've never tried to sort anything, so I went to sorting in CMSBuilder and put in my field names and added DESC to each, then just typed the corresponding name in the sort order field in the form. Do I need to do anything extra in on either side? Thanks for all your help.

John
John C. Morris
Interdimensional Designs
www.covdesigns.com

Re: [blind2uriz] Search Problem

By Dave - February 25, 2009

Hi John,

The viewers don't support specifying sort order through a form yet. Only hard coding it in the admin program or source of the viewer page. The only way to do it currently is with a little bit of custom code.

Once you have everything else working start a new thread about that and attach your viewer file if you can and I'll help you out with it.
Dave Edis - Senior Developer
interactivetools.com