arzhan
08-13-2006, 03:02 PM
I'd been breaking my head on the below issue:
I have a search page that will display 5 results per page.User can navigate using Next and Previous buttons in the search results page. Iam using PHP,MySQL,Apache combo
My Logic:
======
1)When user clicks on search, i get the criertia using $_POST
2)I save the criertia in the session to be used by NEXT and PREVIOUS
I start the session using session_start();
3)When user clicks on NEXT, i call the same PHP file passing some values (like whether user clicked on next/previous,what is the currect page etc)
This code works perfectly fine in my localhost, but doesnt after i hosted the site
Problem:
======
When the user clicks on NEXT, i see the message 'no results' found though there are 15+ results.I tried to print the values of the session variables everytime the PHP file is called and here is what i found out...
1)When the file is executed for the first time,search criteria successfully stored in session.I could retrieve and print them also
2)On clicking Next, the file is called for the second time.But the values of the session variables are different now.It is holding the values of the last record displayed in the first page
And hence the query fails showing me zero records
I dont quite understand as why the session variables are not retained.
Localhost (my m/c)
======
PHP - 4.4.0
Apache - 2.0.54 (WIN32)
Hosting server
=============================
PHP - 4.4.3
Apache - 1.3.37 (Unix)
Have made only one change to my file after i launched. Localhost in the URL replaced by my site name...
Localhost:
<td><A HREF="http://localhost/srch.php?id=2¤tpage=<?php echo $currentpage; ?>"><img src="Next.PNG"/></A></td>
Site:
<td><A HREF="http://www.XYZ.com/srch.php?id=2¤tpage=<?php echo $currentpage; ?>"><img src="Next.PNG"/></A></td>
Any help to resolve this issue will be much appreciated.If you need more information, please let me know.
I have a search page that will display 5 results per page.User can navigate using Next and Previous buttons in the search results page. Iam using PHP,MySQL,Apache combo
My Logic:
======
1)When user clicks on search, i get the criertia using $_POST
2)I save the criertia in the session to be used by NEXT and PREVIOUS
I start the session using session_start();
3)When user clicks on NEXT, i call the same PHP file passing some values (like whether user clicked on next/previous,what is the currect page etc)
This code works perfectly fine in my localhost, but doesnt after i hosted the site
Problem:
======
When the user clicks on NEXT, i see the message 'no results' found though there are 15+ results.I tried to print the values of the session variables everytime the PHP file is called and here is what i found out...
1)When the file is executed for the first time,search criteria successfully stored in session.I could retrieve and print them also
2)On clicking Next, the file is called for the second time.But the values of the session variables are different now.It is holding the values of the last record displayed in the first page
And hence the query fails showing me zero records
I dont quite understand as why the session variables are not retained.
Localhost (my m/c)
======
PHP - 4.4.0
Apache - 2.0.54 (WIN32)
Hosting server
=============================
PHP - 4.4.3
Apache - 1.3.37 (Unix)
Have made only one change to my file after i launched. Localhost in the URL replaced by my site name...
Localhost:
<td><A HREF="http://localhost/srch.php?id=2¤tpage=<?php echo $currentpage; ?>"><img src="Next.PNG"/></A></td>
Site:
<td><A HREF="http://www.XYZ.com/srch.php?id=2¤tpage=<?php echo $currentpage; ?>"><img src="Next.PNG"/></A></td>
Any help to resolve this issue will be much appreciated.If you need more information, please let me know.
