Another php upload error

Discussion in 'PHP' started by nrodes, Oct 19, 2008.

  1. #1
    I have another php error:
    This is my code:

    <?php
    $target = "Videos/";
    $target = $target . basename( $_FILES['uploaded']['name']) ;
    $ok=1;

    echo "Please wait while your file is uploaded.<br>";

    //This is our size condition
    if ($uploaded_size > 350000000)
    {
    echo "Your file is too large.<br>";
    $ok=0;
    }

    //This is our limit file type condition
    if ($uploaded_type !="movie/*" or "image/*")
    {
    echo "Only Videos and Pictures.<br>";
    $ok=0;



    //Here we check that $ok was not set to 0 by an error
    if ($ok==0)
    {
    Echo "Sorry your file was not uploaded";
    }


    //If everything is ok we try to upload it
    else
    {
    if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
    {
    echo "Your file has been uploaded";
    }
    else
    {
    echo "Sorry, there was a problem uploading your file.";
    }
    }
    ?>


    When I test it I get:


    Parse error: syntax error, unexpected $end in C:\Program Files\Abyss Web Server\htdocs\upload2.php on line 57


    I know I probly sound really stupid, but I can't find any variable "$end."

    Could somebody help???
     
    nrodes, Oct 19, 2008 IP
  2. riamathews

    riamathews Peon

    Messages:
    306
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That error means that a loop isn't closed properly
    }

    Please check your code.
     
    riamathews, Oct 19, 2008 IP
    Smyrl likes this.
  3. Kyosys

    Kyosys Peon

    Messages:
    226
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    replace


    if ($uploaded_type !="movie/*" or "image/*")
    {
    echo "Only Videos and Pictures.<br>";
    $ok=0;



    with



    if ($uploaded_type !="movie/*" or "image/*")
    {
    echo "Only Videos and Pictures.<br>";
    $ok=0;

    }
     
    Kyosys, Oct 19, 2008 IP
  4. Conello

    Conello Member

    Messages:
    59
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #4
    yes, missing } only.... :D
     
    Conello, Oct 19, 2008 IP