close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Narrow Your Search Results with Checkboxes

Thread began 2/27/2010 6:15 am by vito374252 | Last modified 2/28/2010 4:34 am by vito374252 | 1396 views | 2 replies |

vito374252

Narrow Your Search Results with Checkboxes

Hi, I would like to create a similar 'narrow your search results' with checkboxes that Dell is using on their UK website. ct.aspx?refid=notebooks&s=dhs&cs=ukdhs1&~ck=mn#

Does anyone know how this can be done?

Thanks

Sign in to reply to this post

anonymous

It is a little complex... but I have created several searches like this. Is what they are doing is using an AJAX script to actually modify the URL variables when you make a selection. If you notice at the top, you can scroll through the URL and you'll see variables added there after making checkbox selections.

It will have something like thispage.php?model=computer1,computer2,computer2&... (please note, I am just making arbitrary names up just to demonstrate how they are doing it).

So what is happening is that all the selection for the type of computer, for example, are being stored into an array of a URL variable. In my arbitrary example, that variable would be model containing an array of comma separated values.

They are then looping through that array in a query to get the drill down of models based on the criteria selected by the user.

They could do that with a for each loop:

first store the array into a variable -

<?php
$allmodels = $_GET['model'];

foreach ($allmodels as $item){ ?>

<?php
mysql_select_db($database_data, $data);
$query_cd = "SELECT * FROM yourtable WHERE column = '$item';
$cd = mysql_query($query_cd, $sjr) or die(mysql_error());
$row_cd = mysql_fetch_assoc($cd);
$totalRows_cd = mysql_num_rows($cd);
?>

<?php do { ?>

Add the information you want to loop through for each query using php echo when needed to bind a variable

<?php } while ($row_cd = mysql_fetch_assoc($cd)); ?>


<?php } ?>


This method will create a loop within a loop... because you'll have a do while statement inside the loop of the array in the query allowing you to display multiple items in order on the screen from each query as it loops through.

Sign in to reply to this post

vito374252

Thanks for the reply. It seems a bit to complicated for me to do this. I am more of a beginner so I will try to do it some other way then.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...