Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Media Submission portal error

    Ok, I have a Medi Submission Portal, where I want users to be able to submit .swf's and .wmv's.

    I am having trouble just letting them upload .swf'd and .wmv's.

    I have this code:

    PHP Code:
    $types=array(".swf",".wav");

    $title=addslashes(strip_tags($_POST['title']));

    $desc=addslashes(strip_tags($_POST['desc']));

    $wide=addslashes(strip_tags($_POST['wide']));

    $high=addslashes(strip_tags($_POST['high']));

    $cat=addslashes(strip_tags($_POST['catergory']));

    $tac=addslashes(strip_tags($_POST['terms_and_conditions']));

    $max_filesize 5000000;

    $filename=rand(500,2000).$_FILES['file']['name'];



    if (
    $title == ""){

    echo 
    "Field title left blank <a href='?'>Go back?</a>";

    }

    elseif(
    $desc == ""){

    echo 
    "Field desccription left blank <a href='?'>Go back?</a>";

    }

    elseif (
    $wide == ""){

    echo 
    "Field width left blank <a href='?'>Go back?</a>";

    }

    elseif (
    $high == ""){

    echo 
    "Field height left blank <a href='?'>Go back?</a>";

    }

    elseif (
    $cat == ""){

    echo 
    "Field catergory left blank <a href='?'>Go back?</a>";

    }

    elseif (
    $tac == ""){

    echo 
    "You must agree to the terms and conditions! <a href='?'>Go back?</a>";

    }

    elseif (!
    is_numeric($wide) || !is_numeric($high)){

    echo 
    "Field width or height false <a href='?'>Go back?</a>";

    }

    elseif (
    $_FILES['file']['name'] == "") {

    echo 
    "Field flash file left blank <a href='?'>Go back?</a>";

    }

    elseif (
    $_FILES['file']['size'] > $max_filesize){

    echo 
    "Error! flash file must not be bigger than 5 MB  <a href='?'>Go back?</a>";

    }

    elseif (!
    strpos($_FILE['file']['type'], $types,-4)){

    echo 
    "File type not accepted";
    }] 
    And so on, that is all that should be needed here.

    This code, unfortunatly, wont let any files through.

    What is the problem here?
    Last edited by Lessur; 02-17-2006 at 02:56 PM.

  • #2
    New Coder
    Join Date
    Feb 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, I have checged it a bit, I now have
    PHP Code:
    elseif ($_FILES['file']['name'] != $type){ 


  •  

    Posting Permissions

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