parse error, unexpected '\"'

Discussion in 'PHP' started by X.Homer.X, Apr 29, 2008.

  1. #1
    I know what this error means, but i just dont know why i am getting it. i am trying to set a variable to $_FILE['file']['type'] so that i can enter it into a mysql database (i dont need help with the mysql part)

    here is my code at where i an defining the variable.

    
          $upload_url = "http://www.gamersinsaninty.com/uploads/".$_FILES['file']['name'].";
          $upload_type = $_FILES['file']['type'];
    
    PHP:
    its giving me the error on line 29 which is the line of

    
          $upload_type = $_FILES['file']['type'];
    
    PHP:
    anyone know why this is happening? i always thought you didnt have to put quotes, or escape anything when its another variable.

    Thanks in advance for any help you provide :)
     
    X.Homer.X, Apr 29, 2008 IP
  2. nihcer

    nihcer Member

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    Clear the double quote:

    $upload_url = "http://www.gamersinsaninty.com/uploads/".$_FILES['file']['name'];
    $upload_type = $_FILES['file']['type'];
    PHP:
     
    nihcer, Apr 29, 2008 IP
  3. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks, although i figured this out and was just coming back to post a "non relevent" post but you already answered me :)

    responses are much quicker here than at the CSS forum.
     
    X.Homer.X, Apr 29, 2008 IP