Re: Subject: Image / file uploader

From: Date: Fri, 30 Apr 2004 18:39:15 +0000
Subject: Re: Subject: Image / file uploader
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-34217@lists.php.net to get a copy of this message
So did you intend for this to happen : Set $dest="". Check source supplied. Set $dest=$uploadpath.$photo_name; Check if $dest="". If $dest="" (which it cant be if you supplied an image), then move the uploaded file (it will never run). Else, echo couldn't store image. You see the problem, yes ? PS why do you check if ($source != '') twice ? Whats that all about ?
        $source = $HTTP_POST_FILES['photo']['tmp_name'];
        $photo_name = $HTTP_POST_FILES['photo']['name'];
        $dest = '';
        if (($source != '') && ($source != '')) {
                $dest = $uploadpath.$photo_name;
                if ($dest = '') {
                        if (move_uploaded_file($source, $dest)) {
                                echo ("<p id='message'>Image and Bio has been successfully stored.</p> ");
                        } else {
                                echo ("<p id='message'>Image could not be stored.</p>");
                        }


« previous php.db (#34217) next »