SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: Screwed!

  1. #1
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Screwed!

    Hi, I'm having this problem with my file.

    I have this file, with ifs, else ifs, and else in it.

    Basicly, I have this else if statement.

    I do it like normal, else if ($act == "test" && $page == "whatever"){

    Then, at the end of it, I close it like this:

    }

    Well, it errors on teh line of teh }!

    Why is this?

    So I take it out of the script, and then I get an error on the NEXT else if statement...

    Any ideas?

    Thanks,
    ~someonewhois

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The first one should be an if:

    if ($act == "test" && $page == "whatever"){

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you've missed a { or } further up.

    BTW, why do you keep typing "teh" in your posts instead of "the?" got some JeffK going on?
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2002
    Location
    Kentucky, USA
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In elseif there shouldnt be spaces like you have.

  5. #5
    And your point is.... redgoals's Avatar
    Join Date
    Feb 2002
    Location
    Birmingham, UK
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    from the manual killer2239

    In PHP, you can also write 'else if' (in two words) and the behavior would be identical to the one of 'elseif' (in a single word).
    must be somethin wrong with the format you are usin someonewhois.
    http://redgoals.com ... my site ... nuff said

  6. #6
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by seanf
    The first one should be an if:

    if ($act == "test" && $page == "whatever"){

    Sean
    I know, this file is 1500 lines long, it's got a lot of else if's!

    I did put an if at the begining.

  7. #7
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by DR_LaRRY_PEpPeR
    you've missed a { or } further up.

    BTW, why do you keep typing "teh" in your posts instead of "the?" got some JeffK going on?
    I don't think I missed an { or } above...

    I type too fast!

  8. #8
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by killer2239
    In elseif there shouldnt be spaces like you have.

    IT can be else if...

  9. #9
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by redgoals
    from the manual killer2239



    must be somethin wrong with the format you are usin someonewhois.
    It's the basic format...

  10. #10
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    There

    I replies to all yours!

    Thanks so mucuh for trying to help, but I did it teh (*the ) easy way:

    I copied anotehr else if statement from above, and just edited it in... that worked!

    Thanks,
    ~someonewhois


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
  •