My script consists of SELECT form and bellow data processing output depending on selected and submitted item.
Like this:
Select name:
<Joe> {other choices are <Peter> <Jane>}
[OK]
Joe’s age is 22.
The age is taken from database. For first run, the first item is selected, that’s fine.
For the first run the firsts item from SELECT is selected and processed.
Next time I choose <Jane>. Result:
Select name:
<Jane>
[OK]
Jane’s age is 31.
I am recursively calling the same php script and passing selected value through $HTTP_POST_VARS. Second and next runs, all is OKay. $HTTP_POST_VARS[name] is filled with name. This is dynamically used for SELECT for “selected item” and for database query.
The only problem is a warning during the first run when $HTTP_POST_VARS is not initialized but it is used for creating form SELECT and db query.
Can I manually found out if $HTTP_POST_VARS[name] exists isset()?
If it is not initialised/existing, can I set up default: $HTTP_POST_VARS[name] = “Joe” for the first run?
Thank you for advice in advance.
Like this:
Select name:
<Joe> {other choices are <Peter> <Jane>}
[OK]
Joe’s age is 22.
The age is taken from database. For first run, the first item is selected, that’s fine.
For the first run the firsts item from SELECT is selected and processed.
Next time I choose <Jane>. Result:
Select name:
<Jane>
[OK]
Jane’s age is 31.
I am recursively calling the same php script and passing selected value through $HTTP_POST_VARS. Second and next runs, all is OKay. $HTTP_POST_VARS[name] is filled with name. This is dynamically used for SELECT for “selected item” and for database query.
The only problem is a warning during the first run when $HTTP_POST_VARS is not initialized but it is used for creating form SELECT and db query.
Can I manually found out if $HTTP_POST_VARS[name] exists isset()?
If it is not initialised/existing, can I set up default: $HTTP_POST_VARS[name] = “Joe” for the first run?
Thank you for advice in advance.