1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Stupid Parse Error

Discussion in 'PHP' started by nfzgrld, Apr 13, 2005.

  1. #1
    I'm getting a really strange error in a php script. When I try to run this script it returns a parse error on the last line of the file. This line is outside the last ?> tag. It started after an edit I did. When I started getting the error I undid that edit and the problem didn't go away. Not only that, but when I went back and undid every edit I'd made since opening the file for those edits the problem still didn't go away, and it didn't exist before that last edit. WTF? :confused:
     
    nfzgrld, Apr 13, 2005 IP
  2. mushroom

    mushroom Peon

    Messages:
    369
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Normal result when a bracket is not closed "}"
     
    mushroom, Apr 13, 2005 IP
  3. fryman

    fryman Kiss my rep

    Messages:
    9,604
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #3
    What's the url where you are getting the error?
     
    fryman, Apr 13, 2005 IP
  4. nfzgrld

    nfzgrld Peon

    Messages:
    524
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I know, I've been over every single line of code three times. I've seen this before and that was the case, but I can't find an open bracket anywhere, and I've been looking for the damn thing for two days now!
     
    nfzgrld, Apr 13, 2005 IP
  5. nfzgrld

    nfzgrld Peon

    Messages:
    524
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    There is no URL. I'm doing this development on an internal server. It's not accessable to the web.
     
    nfzgrld, Apr 13, 2005 IP
  6. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #6
    White space after the closing ?> starts output. You cannot use a file like this in an include, are you? That's all I got.
     
    noppid, Apr 13, 2005 IP
  7. mushroom

    mushroom Peon

    Messages:
    369
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If you make the file available I would be happy to look it over for you.
     
    mushroom, Apr 13, 2005 IP
  8. nfzgrld

    nfzgrld Peon

    Messages:
    524
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I already checked for the whitespace, and no, it's not an include.
     
    nfzgrld, Apr 13, 2005 IP
  9. mushroom

    mushroom Peon

    Messages:
    369
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #9
    One more thing that may be worth looking for is missmatched brackets as this can be over looked, "{" looks much like "("
     
    mushroom, Apr 13, 2005 IP
  10. iconv

    iconv Well-Known Member

    Messages:
    189
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #10
    And check for an unmatched ' or "
     
    iconv, Apr 13, 2005 IP
  11. mushroom

    mushroom Peon

    Messages:
    369
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #11
    An easy way of doing this is to take a copy of your script to an advanced text editor, one that with do find and replace and tell you how many replacements where made.
    Find "{" replace with "AAA", then find "}" replace with "BBB" and make sure the counts match, do with the other brackets "()[]"
     
    mushroom, Apr 13, 2005 IP
  12. rvarcher

    rvarcher Peon

    Messages:
    69
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Let's see the code. First one to find the error get's a prize.
     
    rvarcher, Apr 13, 2005 IP