Re: INPUT tag with default value
| From: | Richard S. Crawford | Date: | Tue, 23 Oct 2001 17:03:07 +0000 |
| Subject: | Re: INPUT tag with default value | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71965@lists.php.net to get a copy of this message | ||
It is possible to utilize a VALUE attribute with a FILE type input field. Even the specs at Blooberry list "value" as an attribute of the input type=file field. I double-checked at w3c.org to make sure, though, and found the information repeated there. I even checked my O'Reilly book on XHTML. :) O'Reilly suggests, though, that because of the vagaries of individual file systems on individual computers, the VALUE attribute just isn't recommended.
I suggested the use of the htmlspecialchars() function to strip possible quotes from the value of $photo in the original author's example, as in:
<input type="file" value="<? echo htmlspecialchars($photo); ?>">
I struggled with exactly this problem a couple of weeks ago. In the end I decided that using the VALUE attribute was just a bad idea, since one could never know how the user had set up their own file system.
At 09:47 AM 10/23/2001, Philip Olson wrote:
This is not possible. Default values cannot be set with type=file as if itSliante, Richard S. Crawford http://www.mossroot.com mailto:rscrawford@mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!"were it would be quite a security risk. A little more information onthe capability of this html form element: http://www.blooberry.com/indexdot/html/tagpages/i/inputfile.htm And a related RFC : http://www.faqs.org/rfcs/rfc1867.html regards, Philip Ollson