Re: I am try to upload an image to a folder on my web server
| From: | Brad Thomas | Date: | Tue, 10 Jun 2003 01:04:58 +0000 |
| Subject: | Re: I am try to upload an image to a folder on my web server | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-20255@lists.php.net to get a copy of this message | ||
Hi
Firstly, I would like to point out that programming with register_globals on
is a bad move, in sense of security.
Secondly, I'd suggest using isset for checking if there is anything in the
$_FILES superglobal. (If you're using post 4.1, of course.)
"Stephen K Knight" <stephen@fmwebschool.com> wrote in message
news:001801c2e46d$4e1bad00$8cfafea9@stephen...
> I am trying to upload an image to my webserver. This is the PHP page that
> is called from my html page. I am trying to upload the image to my folder
> called "logos" the direct link would be: C:\Program Files\Apache
> Group\Apache2\htdocs\logos I am not sure what I am doing wrong in the
code
> below. Can someone please look and help me so that I can upload the image
> to that folder.
>
> Thank you!
> In Kindness
> Stephen K Knight
>
>
> <?
>
> if(!empty($userfile))
> {
> $abpath = "/logos/" . $newname;
>
> echo "FileUpload2.php";
> echo $username;
> echo $newname;
> echo $abpath;
>
> //copy the file
> // copy($userfile, "$abpath");
>
> //destroy the uploaded file
> // unlink($userfile);
>
> // write javascript to store the newname
> // echo "<script language='javascript'>\n";
> // echo "newname = '" . $newname . "';\n";
> // echo "</script>\n";
> }
>