Re: upload problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 22, 2008, at 5:01 PM, nihilism machine <nihilismmachine@xxxxxxxxx> wrote:

any ideas why this does not work?


class upload {

   function upload() {
       upload::uploader();
   }

   function uploader() {
       $FileName = basename($_FILES['upload1']['name']);
if (move_uploaded_file($_FILES['upload1']['tmp_name'], $FileName)) {
           chmod($FileName, 0755);
           rename($FileName, "admin/advertisements/" . $FileName);
           return $FileName;
       } else {
           return "Error!";
       }
   }
}

Try deleting the upload() function. Then:

$test = new upload();
$filename = test->uploader();

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux