I've got a form that asks for some user input. I don't want the php code on the form to execute until the values have been filled out and the form submitted.
What's the best way to do this? I was checking for null values in the fields but I still get this error when the form first loads (before values are entered):
Notice: Undefined index: tbname in D:\wwwroot\secured\tablepick.php on line 82
Where 'tbname' is one of the field names. I get a notice like this for each field value I'm trying to read.
I tried using $POST['tbname'] and placing it in a variable then checking for a value. But I'm assuming it's not working because $POST is empty. I'm just not sure what the best way to check for this kind of stuff would be.
Also, is there a way to execute some php code when a user clicks a button without submitting a form?