What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » A little help with php please

A little help with php please
Author: Message:
hmaster
Senior Member
****

Avatar

Posts: 716
Reputation: 24
33 / Male / Flag
Joined: Nov 2004
RE: A little help with php please
This is some sample upload code I used, I think it's because you havn't used the $_FILES variables

code:
    #upload

    if(@$_POST['submit']) {
        $target_path = "gallery/images/";
        $filename = basename($_FILES['uploadedfile']['name']);
        $filename = str_replace(" ", "", $filename);
        $target_file = $target_path . $filename;
           
            if(empty($filename) || $filename == " ") {
            header("Location: upload.php?error=1");
            } elseif(file_exists($target_file) && @$_POST['ovrwrtf'] != "on") {
            header("Location: upload.php?error=3");
            } else {
                if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_file)) {
                    header("Location: img.php?filename=$filename");
                } else {
                header("Location: upload.php?error=4");
                }
           }
    }
?>

I think move_uploaded_file() works better than copy() when uploading *-)

This post was edited on 06-20-2006 at 05:50 PM by hmaster.
[Image: sig.png]
06-20-2006 05:47 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
A little help with php please - by Nathan on 06-20-2006 at 04:48 PM
RE: A little help with php please - by Mnjul on 06-20-2006 at 04:50 PM
RE: A little help with php please - by Nathan on 06-20-2006 at 05:08 PM
RE: A little help with php please - by Mnjul on 06-20-2006 at 05:15 PM
RE: A little help with php please - by Nathan on 06-20-2006 at 05:19 PM
RE: A little help with php please - by Plik on 06-20-2006 at 05:34 PM
RE: A little help with php please - by hmaster on 06-20-2006 at 05:47 PM
RE: RE: A little help with php please - by -dt- on 06-21-2006 at 03:48 AM
RE: A little help with php please - by Lou on 06-21-2006 at 03:58 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On