I've encountered what at first glance is a very odd problem. However, I think I may know what the problem is but don't know how to get around it.
I have a script that accesses a database table and allows the user to move between and view each record. So far, two form buttons have been implemented ... Previous and Next (to move to the previous and next records in the database).
One variable within the script was giving me a headache. It simply keeps track of the current record number (it's compared with another variable that keeps track of the total number of records in the table).
The problem was that I could only access the first two records. But I now think I know what the problem is.
I'm using the $PHP_SELF to reload the form after a button is pressed. It now seems to me that this variable, which is created outside the form, is cleared every time I press a button thereby causing the problem I'm experiencing.
Is there a way of passing a variable back to the original script when using $PHP_SELF?