Re: Tr: [PHP] New to PHP - Undefined variable: ??????
| From: | Philip Olson | Date: | Thu, 02 May 2002 00:32:35 +0000 |
| Subject: | Re: Tr: [PHP] New to PHP - Undefined variable: ?????? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95630@lists.php.net to get a copy of this message | ||
Some things to consider:
a) please read my first post :) (re: isset/empty/error_reporting)
b) $FILE != $File != $file (case sensitive)
regards,
Philip Olson
On Thu, 2 May 2002, nico_free wrote:
>
> ----- Original Message -----
> From: nico_free <nayco@free.fr>
> To: TGL <faytrick@thegospellady.com>
> Sent: Wednesday, May 01, 2002 11:47 PM
> Subject: Re: [PHP] New to PHP - Undefined variable: ??????
>
>
> > Well, I think the first 2 lines of your script should be :
> >
> > echo "\$FILE : $FILE";
> > var_dump($FILE);
> >
> > So, when submitting with no file, you should see some clues....
> >
> > As far as I remember, your first test should be :
> >
> > <--code-->
> > if($File!="none") {
> > print ("File name: $File_name<P>\n");
> > ...etc............
> > <--/code-->
> >
> > @++++
> >
> > ----- Original Message -----
> > From: TGL <faytrick@thegospellady.com>
> > To: <php-general@lists.php.net>
> > Sent: Tuesday, April 30, 2002 10:44 PM
> > Subject: [PHP] New to PHP - Undefined variable: ??????
> >
> >
> > > I'm new to PHP and can't get through my first script. I want to create a
> > > form that will allow the user to attach a file. I started with the file
> > > upload part of the form thinking that it ould give me the most problem,
> > and
> > > it has.
> > >
> > > This is the error message that shows when I view the page in the
> browser:
> > >
> > > Warning: Undefined variable: File in
> > > D:\inetpub\thegospellady\www\kia\form.php on line 8
> > > here is the url to the form:
> > > http://www.thegospellady.com/kia/form.php
> > >
> > > Please help.
> > >
> > > <?php
> > > /* This next conditional determines whether or not to handle the form,
> > > depending upon whether or not $File exists. */
> > > if($File) {
> > > print ("File name: $File_name<P>\n");
> > > print ("File size: $File_size<P>\n");
> > > if(copy($File, "/users/$File_name")) {
> > > print ("Your file was successfully uploaded!<P>\n");
> > > } else {
> > > print ("Your file could not be copied.<P>\n");
> > > }
> > > unlink($File);
> > > }
> > >
> > > print ("Upload a file to the server:\n");
> > > print ("<FORM ACTION=\"form.php\" METHOD=POST
> > > ENCTYPE=\"multipart/form-data\">\n");
> > > print ("File <INPUT TYPE=FILE NAME=\"File\"
> > > SIZE=20><BR>\n");
> > > print ("<INPUT TYPE=SUBMIT NAME=\"SUBMIT\"
> VALUE=\"Submit!\"></FORM>\n");
> > > ?>
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>