SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: $_FILES problem

  1. #1
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $_FILES problem

    hi...
    i cant solve this problem....
    my $photop variable is empty all the time and doesnt output anything!!!
    this is the function...
    PHP Code:
    function goproduct() {
    global 
    $uploaddir;
    $category $_POST["cat"];
    $type $_POST["type"];
    $name $_POST["product_name"];
    $photop $_FILES["userfile"]["name"];
    $uploadfile $uploaddir $_FILES["userfile"]["name"];
    $text $_POST["text"];
    $techtext $_POST["techtext"];
    $ret "INSERT INTO products VALUES('', '$category', '$type', '$name', '$photop', '$text', '$techtext')";
    $ret mysql_query($ret);
    if(
    move_uploaded_file($_FILES["userfile"]["tmp_name"], $uploadfile)) {
    echo 
    "<div id='alert' style='right:0px;padding-left:5px;top:0px;position:absolute;color:red;background-color:white'>Podaci su uspješno spašeni!</div>";
    } else {
    echo 
    "<div id='alert' style='right:0px;padding-left:5px;top:0px;position:absolute;color:red;background-color:white'>Neuspjeh! Klikni nazad u browser i ponovi operaciju.</div>";
    }

    and the input type file have name userfile...
    anyone see here some error couse the data enters in database...
    just $photop var is empty...
    suggestions???
    thanx in advance!

  2. #2
    SitePoint Zealot shaman's Avatar
    Join Date
    Feb 2005
    Location
    W.R. Home
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <form enctype="miltipart/form-data"> yeap?
    She's my german fraulein

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OMG....
    thank you very much.....
    lol what a dumb...
    thanx again

  4. #4
    SitePoint Zealot shaman's Avatar
    Join Date
    Feb 2005
    Location
    W.R. Home
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    all stumble 8)
    She's my german fraulein


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •