I want to know if its possible to get the value from a form if I click the submit button. My code works when I change the variable $page it will call the current $page number in the API through the list of pages, now I want to initialize the variable $page using a form input/button value but I can’t seem make it work. I should get $page value first before calling the API
- Get the $page from the form data (if it is >=1) or use 1 if there wasn’t a valid number given
- Call the API with the page number
- Show the results like normal
- In the form, if $page > 1 then show the Prev button, and if $page < number of pages then show the Next button
- For the two buttons, give them a name of “page” and a value of $page - 1/$page + 1 appropriately: when someone clicks either button then that will submit a “page” in the form data for your code to use
Any help, suggestion or example is greatly appreciated. PHP Code || API