by revq » Mon Feb 27, 2006 8:05 am
<input type="hidden" ...> is a field on the html page that holds a value but doesnt display it, anytime you need to store a value in the form but the user mustn't see it, you use the hidden input type. enctype="multipart/formdata" just tells the page that processes the form, in this case "save.php" what form the data is transmitted in. enctype -> encoding type. This must be set on any form where you are uploading a file. The hidden field, <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> is a field that 'save.php' can look at to see if the file is too large.
Basically this form does the following :-
1) specifies the page that will process it - (action="save.php")
2) specifies the way the data will be sent - (enctype="multipart/formdata")
3) specifies how it must be referred to by 'save.php' - (method="post")
4) specifies the maximum file size for 'save.php' to look at - (<input type="hiden" name="MAX_FILE_SIZE" value="1000000">)
5) allows the user to select a file - (<input type="file" name="uploadedfile">)
6) shows a submit button that will send all the data to 'save.php' - (<input type="submit" value="uploadfile">)