Hi guys
I was hoping you could help:'(, I have created a web page where by the number of records is about 40.
But put on paging on my page with the use of Dream weaver. The problem I have is that yes it does display 5
At a time using the limit in my sql statement but when I click on the next page it says that the value in the text field
Is undefined. The scenario is that there is a form with a text field name "txtnum" when I click the submit I have used the post method
Where the value will be stored in a variable on the php file. $num = $_Post. I have tried using a session with no success. $_Session[‘num’]=$_Post[‘textfield’];
And also some of the Post I am using is incorporated in my sql statement. I need help on how to hold the same value and for a post so that it appears on the next page when I page.

Dani AI

Generated

The problem described by is almost always caused by losing the POST data when the pager link is clicked. A normal link click issues a new GET request, so any form values sent by POST are not present on the next page. As hinted, session storage is an option — but it must be initialized and used consistently on every script that reads/writes the session. Another simple option is to carry the value in the pager links or in hidden form fields so each page load still receives the filter value.

Use a fallback that reads the value from POST first, then from GET (pager links), and only then from session if you prefer persistence. For example:

$txtnum = isset($_POST['txtnum']) ? $_POST['txtnum'] : (isset($_GET['txtnum']) ? $_GET['txtnum'] : '');

<!-- include the current filter in pager links -->
<a href="list.php?page=2&txtnum=<?php echo urlencode($txtnum); ?>">Next</a>

Troubleshooting checklist:

  • Confirm the form field name exactly matches what your PHP reads.
  • Check Dreamweaver’s generated pager links to ensure they keep or include your parameter.
  • If using sessions, make sure session handling runs before any output and that you use the correct superglobal names (PHP is case-sensitive).
  • Never inject raw POST/GET into SQL — use parameterized queries or proper escaping.

Reference: PHP docs on POST variables and basic session usage are useful starting points ($_POST manual, session basics, urlencode).

Recommended Answers

All 2 Replies

do you have

session_start();

at the top of the page?

Yes I do have an session start.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.