RE: [PHP] Uploaded File OverWriting Old File
| From: | John Holmes | Date: | Sat, 11 May 2002 18:01:48 +0000 |
| Subject: | RE: [PHP] Uploaded File OverWriting Old File | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-97128@lists.php.net to get a copy of this message | ||
> > copy("$img1", "mjpalpics/$img1_name") or Die ("Could
> > not do");
> >
> > Sends the images to the mjpalpics Directory!
> Possibly. But one thing that is definitely a problem is:
>
> if(file_exists($img1_name)) {
> $img1_name = "n"+$img1_name;
> }
>
> should be:
>
> if(file_exists($img1_name)) {
> $img1_name = "n" . $img1_name;
> }
Umm...wouldn't you want to use file_exists("mjpalpics/$img1_name")
instead? Otherwise you're not checking for it existing in the same place
you are copying it to...
---John Holmes...