On Tue, 2 Jul 2002 23:45:56 +0800
Jason Wong <[EMAIL PROTECTED]> wrote:
> On Tuesday 02 July 2002 23:34, Tyler Longren wrote:
> > Hi,
> >
> > I have a form kinda like this:
> > <form action=$PHP_SELF?option=Mass&action=add method=POST
> > enctype=multipart/form-data>
> > <input type=file name=passcodeFile>
>
> You really should use "" around your tag values. What you have is
> invalid HTML.
>
> > the rest of the form is there too. And $PHP_SELF is set to
> > $PHP_SELF =$_SERVER[PHP_SELF] at the top of the page.
> >
> > When I select a passcodeFile file to upload and click the "upload"
> > button, I am presented with this on the next page:
> > "You need to specify a file to use."
> >
> > Here's what I did:
> > if ($_POST[passcodeFile] == "") {
> > print "You need to specify a file to use.";
> > }
> >
> > Any ideas why it does that even if I do select a file?
>
> 1) print_r($_POST) to see what you have, while you're at it, do the
> same for $_FILES.
>
> 2) Use the example(s) in the manual, once you have them working modify
> to suit.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development
> *
>
> /*
> Nature always sides with the hidden flaw.
> */
that worked. I had to use _FILES instead of _POST
I still get these errors though:
"Warning: fopen("", "r") - Success in
/usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 151
Warning: stat failed for (errno=2 - No such file or directory) in
/usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 151
Warning: fread(): supplied argument is not a valid File-Handle resource
in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line
151"
And here's the line that produces them:
$data = fread(fopen("$_FILES[passcodeFile_name]", "r"),
filesize("$_FILES[passcodeFile]"));
any ideas on that one? This is the problem I have been working on for a
few days now.
Thanks,
Tyler
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php