On Thu, 19 Jul 2001 16:06, Jason Rennie wrote:
> Hi all,
> Can anybody see what is wrong with this code ??
>       echo "\$userfile = $userfile";
>       echo $HTTP_POST_FILES['userfile']['tmp_name'];
>       // now to provide an assignment submission box
>       print "<P>";
>       print "<FORM ENC_TYPE=\"multipart/form-data\"
> ACTION=\"$param&upload=true\" METHOD=\"post\" >\n"; print "<INPUT
> TYPE=\"hidden\" NAME=\"MAX_FILE_SIZE\" VALUE=\"1048576\">\n"; print
> "<H4>Submit A File</H4><P> ";
>       print "<INPUT TYPE=\"file\" NAME=\"userfile\" >\n<P>";
>       print "<INPUT TYPE=\"submit\" VALUE=\"Upload\">\n";
>       print "</FORM>";
> this is just a code fragment but, essentially the form submits back to
> itself.
> When i try to output the $HTTP_POST_FILE['userfile']['any thing']
> variables they are not set, and $userfile is simply set to the filename
> on the other computer.
> Any ideas about what an earth i'm doing wrong ????
> Jason

It's been a while since I needed to do this, but here's what I wrote and 
as far as I know it still works :-0

<FORM ENCTYPE="multipart/form-data" ACTION="<?php echo 
basename($PHP_SELF)?>" NAME="files" METHOD=POST>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000">
<INPUT NAME="userfile" TYPE="FILE" SIZE="40">
<INPUT TYPE=submit VALUE="Submit File">

[Lots left out for simplicity]
I notice you have ENC_TYPE ??

David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc

   Heads I win, tails you lose.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to