Hi,
I have a script that works OK but I'm not sure if it's by design or by accident.
On pages 91 through 94, Larry advises on how to use PHP redux, a technique that I use often.
Here's my scenario:
I have a PHP script, let's call it script one, that calls PHP script 2 and passes a key value to it. I test for a key value as the first thing in script 2 via 'if (isset($GET['key']))' and retrieve its value. This works fine.
Then script 2 uses that key value to populate a form with values from a database select. The user is able to change any of the values in the form. Script 2 then calls itself via PHP redux.
Now this is the part that I don't quite understand. The form is method=POST and that same key value is included in the form via an input type=hidden, a name of 'key', and the value via a PHP echo.
But the test for isset($GET['key']) still works and retrieves the correct value for key. But the form is POST? On the URL for the redux-called script two I can see the '?key=key-value suffix.
Can someone please help me understand this?
Thank you in anticipation.