I have a page I am working on that I need to store a posted variable... in this case, a button hit. This page (form) resubmits to itself.
My HTML command for the button looks like this....
<input type="submit" name="bSend" value="SEND">
Pretty straight forward.
At the top of the page, I have this line....
$bSend=$_POST["bSend"];
echo "Button=" . $bSend . "<br>";
echo "Post=" . $_POST["bSend"] . "<br>";
The last two lines are for testing purposes....
When I test this... the Button line shows nothing, but the Post line show SEND
This was driving me nuts... until, by chance, I added above the first line...
$bSend="";
Then when I ran it, both the Button and Post BOTH show SEND.
I was under the assumption that in PHP you don't have to predefine variables.
Am I missing something?
Thanks