PDA

View Full Version : Undefined Index


topdog
07-08-2009, 10:34 PM
Still following David J's videos on PHP - now adding data.

Setup variables:-
$data2 = $_POST['data2'];
$data3 = $_POST['data3'];
$data4 = $_POST['data4'];
$submit = $_POST['submit'];

When I preview this in a browser I get:

Notice: Undefined index:data2 in C:\\\dwc.php
and the same message for the other three variables.

As this has not yet been covered in the tutorials. I wondered what was going on.

But the form is still usable in as much as if I leave a field blank, I get the correct error message.
Brian

edbr
07-09-2009, 01:54 AM
C:\\\dwc.php
guessing , but it sounds like you are not using a test server , or have not defined a site correctly

topdog
07-11-2009, 03:29 PM
Problem now fixed -David J responded by email.

Brian

domedia
07-11-2009, 04:05 PM
Can you post it here then?

topdog
07-11-2009, 10:05 PM
Not sure about the ethics of posting private communications on a public site. However, because there is nothing personal or nebulous in the post the gist was:-


The php.ini file needed to be changed to reduce the severity of the error catching by php. Chose the option which did not display the error messages for notices

Brian