• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search Form

#1
[eluser]steviez[/eluser]
Hi,

I am trying to make a search for for my site that will allow my users to search for other members based on a few options.

For example there will be these options on the form:

- Name
- Profile Type
- Age
- Location

and possibly a few more. Now I know roughly how to get all these options passed to the script via post but how could I make it all paginate without the use of query strings?

Thanks

#2
[eluser]Twisted1919[/eluser]
One way, maybe use uri segments like:
Code:
site.com/search/index/encode-username/encode-profile-type/integer-age/encoded-location

<?php
$name=$this->uri->segment(3);
$profile_type=$this->uri->segment(4);
$age=$this->uri->segment(5);
$location=$this->uri->segment(6);
?>
Be careful at the restriction characters of the uri segments(maybe base64_encode() ? )

Another way, is session, save the search params in session and use them when paginate.

Another way, through database, you create a special table for the search, and store a unique hash in it and the search params. Smth like :
Code:
url : site.com/search/index/md5($string)/page/4

<?php
$hash=$this->uri->segment(3);
//query the database using $hash to get the search params, then use the search params to get the search results.
?>

You see, we have solutions Wink


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.