I have a form on my website that carries out a number of validation checks on the data that the user enters.
If there are any problems then the user is returned to the form with an error message detailing the problem. Obviously I want the previously entered data to be retained. I have had no problems doing this with the text boxes using the following piece of code
<input type="text" name="phone" id="phone" value="<?=$_POST['phone']?>" maxlength="20" />
I am having a problem applying this same logic to the checkboxes in my form, obviously if they are ticked I want them to remain so.
Also, I have a field for uploading files on the form. I want the same thing to apply to this field so that the user doesn't have to re-select the file they want to upload.
Currently I am using the following code
<input type="file" name="fileatt" id="fileatt" value="<?=$_POST['fileatt']?>" />
At the moment this part of the code isn't working. Any advice on either count?
Thanks in advance,