Jean-Christian Imbeault wrote:
> Gary wrote:
>
>>
>> They are not really errors they are reporting that the form fields are
>> empty until the form is submitted.
>> Notice: Undefined index:
>
>
> That means your code is not doing any checking of the incoming data. You
> should always check that the data coming is what you expect it to be.
> It's good programming practice and helps security.
>
> Just add the following to your code and every thing will be fine
> (assuming POST, but works with GET or any other):
>
> if (isset($_POST["myvar name"])) {
> $value = $_POST["myvar name"];
> }
> else {
> $value = "";
> }
>
The problem is the vars will never be set until the form is submitted.
The e-notice's are for the
empty form elements before the form submission. So the "else value"
would be, turn off error reporting until submission.
Gary
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php