Page 1 of 1

Search Form Problem with paged reults

Posted: Thu May 14, 2009 3:47 am
by JC2710
Hi

I have a page that submits a form that returns paged results.

This works for the first page but when I click on page 2 nothing is displayed.

I think it has to do with my form and the action. At the moment I have:

Code: Select all

<form  name="Search" method="post" action="search.php?go"  id="searchform">  
and further down I have:

Code: Select all

if(isset($_GET['go'])){.............
Is this correct?

Thanks

Re: Search Form Problem with paged reults

Posted: Thu May 14, 2009 4:24 am
by Yossarian
Use var_dump( $_GET ) when you cannot figure out what your postback form interprets data as.

Re: Search Form Problem with paged reults

Posted: Thu May 14, 2009 4:35 am
by JC2710
That gives me:

Code: Select all

array(1) { ["page"]=> string(1) "2" }
??

Re: Search Form Problem with paged reults

Posted: Thu May 14, 2009 5:26 am
by Yossarian
Well that means you have a form element called "page" in your form and you picked an item with the value "2".

See, it did not recognise ?go because that has no value, and is therefore not set.

/?go=yes&page=2

Is what you are after, or maybe its just plain: /?go=2

It might be better if you explain what you are trying to achieve, moving to different pages depending on form submission or maybe just clean urls?

Re: Search Form Problem with paged reults

Posted: Thu May 14, 2009 6:31 am
by JC2710
OK

Thanks for your help!

I think ive solved problem!

Thanks