PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Jul 06, 2007 1:13 pm
The search query is done via post. The landing page provides a search id and pagination through get.
superdezign
DevNet Master
Posts: 4135 Joined: Sat Jan 20, 2007 11:06 pm
Post
by superdezign » Fri Jul 06, 2007 1:25 pm
feyd wrote: The search query is done via post. The landing page provides a search id and pagination through get.
And then saved via sessions...?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Jul 06, 2007 1:44 pm
superdezign wrote: And then saved via sessions...?
Cached in the database for a period of time.
superdezign
DevNet Master
Posts: 4135 Joined: Sat Jan 20, 2007 11:06 pm
Post
by superdezign » Fri Jul 06, 2007 2:06 pm
That's an approach I haven't heard of before. Not something that would be done (efficiently) on a search engine.
shivam0101
Forum Contributor
Posts: 197 Joined: Sat Jun 09, 2007 12:09 am
Post
by shivam0101 » Fri Jul 06, 2007 6:56 pm
After using POST method, i am getting the results. Problem starts in the hyper links(first, previous, next, last). How to pass the search condition when i click on these links. The link conditions should not appear in the address bar.
nathanr
Forum Contributor
Posts: 200 Joined: Wed Jun 07, 2006 5:46 pm
Post
by nathanr » Fri Jul 06, 2007 7:50 pm
you could always control all the paging by saving the current paging settings in session.. although why not just leave them in the uri?
shivam0101
Forum Contributor
Posts: 197 Joined: Sat Jun 09, 2007 12:09 am
Post
by shivam0101 » Sat Jul 07, 2007 12:44 am
$_SESSION['searchcond']=$_POST['cond'];
and in the each subsequent page i should use,
$condition=$_SESSION['searchcond'];
is that right. (after session_start at the top).
shivam0101
Forum Contributor
Posts: 197 Joined: Sat Jun 09, 2007 12:09 am
Post
by shivam0101 » Sun Jul 08, 2007 10:04 am
Thanks for helping me to solve this. This is how it was solved.
Code: Select all
<?php
echo '<form method='post'>';
?>
after i post,
Code: Select all
<?php
if($_POST)
$_SESSION['condition']=$_POST;
?>
for the navigation,
Code: Select all
<?php
$num=$_GET['num'];//next page
?>