General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 30th, 2003, 09:05 AM
Mojoman's Avatar
Mojoman Mojoman is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Washington, DC
Posts: 39 Mojoman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 34 m 34 sec
Reputation Power: 6
Help passing criteria within a "search maze"...

...I am building a five page search "maze" with PHP and MySQL. What I mean by maze is - on the first page, the user is presented with four categories the user may want to search. Each page has many search criteria in the form of checkboxes and pulldowns (i.e no text fields).

So basically, on the first page the user can choose to search criteria on any combination of pages - i.e. 2, 3 and 4. So on page 2, the user would select search options then get routed to page 3, where he/she would select more search options, then again get routed to page 4 where he/she would select more options, then query the database with all the criteria combined.

I have already created a system for routing the user through the pages, but I'm not sure how to pass the search variables from page to page with new variables being added on each page - or even IF I should be passing the search variables from page to page!

Am I going down the right path? Or should I be quering the db after each page and caching the results in the background without showing the results until the last page is done? (and if so - how do I do it?)

PLEASE HELP!!!!!!

- TIA!
__________________
$mybrain = "mush";
-------------------------------------------
http://www.loftsboston.com
http://www.gregdawsondesign.com

Last edited by Mojoman : April 30th, 2003 at 09:08 AM.

Reply With Quote
  #2  
Old April 30th, 2003, 09:41 AM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 7
Quote:
So basically, on the first page the user can choose to search criteria on any combination of pages - i.e. 2, 3 and 4. So on page 2, the user would select search options then get routed to page 3, where he/she would select more search options, then again get routed to page 4 where he/she would select more options, then query the database with all the criteria combined.

That is the quickest way to drive a user browser your site crazy.
Quote:
I have already created a system for routing the user through the pages, but I'm not sure how to pass the search variables from page to page with new variables being added on each page - or even IF I should be passing the search variables from page to page!

Absolutely not - you should allow the ability to search anything through your site in one form.
Quote:
Am I going down the right path?

No - see the above.
Quote:
Or should I be quering the db after each page and caching the results in the background without showing the results until the last page is done? (and if so - how do I do it?)

You are doing things the hard and inefficient way.

How much data do you have to search through? How many different types of searches do you want to allow? Are you currently using regular expressions in your search queries or are you using the more efficient and faster full text search capabilities of MySQL?
__________________
~ Joe Penn

We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set?

Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you.




Reply With Quote
  #3  
Old May 1st, 2003, 08:24 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to avit
jpenn,

On the whole I agree with you--I hate multipage forms too. It's definitely nicer to input everything all at once and click "go" to get results, right now. I can however envision situtations where that would be difficult to implement: imagine dynamic dependencies where selecting one option would change a good portion of the form. In those situations, you might need to write a whole lot of JavaScript to make it work, and even then it's not always possible because sometimes the adjustments to the form have to come from server-side...

Mojoman,

It really depends on what your form is supposed to accomplish. Again, try not to design it too many levels deep; try to keep as much input grouped together on one page when you can.

Very simplistic, but you can do something like this in your form action script:
PHP Code:
switch ( $_GET('formtype') ) {
  case 
'A' :
    include(
'form_A.php');
    break;
  case 
'B' :
    include(
'form_B.php');
    break;


Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Help passing criteria within a "search maze"...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT