Hello
I have a user input form where I need to ensure that a certain field has been completed before adding the results to the database.
I am checking to see if this field is empty but cannot get the code to work properly;
The field on the form is just
<input type="text" name="MachineId[]" size="3">
then after the rest of the form, a submit button
<input type="submit" name="submit" value="Submit">
the form is processed onto to another files where the data is assessed and added to the database
at the beginning of this code I have added
IF ($_POST['MachineId'] == " ")
{echo "<font face=\"Arial, Helvetica, sans-serif\">Please ensure you have added the <b>Machine Code </b>";
// then the code goes on to verify the user input information
// and then add it to the database
firstly the code isn't picking up on whether this field is empty
secondly how do I get the code to say, if this field is empty, go back to the form and enter the correct information whilst keeping what the user has already input in the other fields, but if this empty has data in it OK carry on with the rest of the code........
TIA