Easy PHP fix?????

Discussion in 'PHP' started by SearchBliss, Jun 3, 2009.

  1. #1
    I have a PHP code snippet that gets ignored, there is no parsing error, and I can't fiqure out why? Please help me if you can. The result of (getIt($mySite) returns a number between 0 and 2, yet this code is ignored???

    if (getIt($mySite) == "0")
    echo "<img src=0.jpg>";
    
    elseif (getIt($mySite) == "1")
    echo "<img src=1.jpg>";
    
    else
    echo "<img src=2.jpg>";
    Code (markup):
    Thanks!
     
    SearchBliss, Jun 3, 2009 IP
  2. jsamdirect

    jsamdirect Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    what is getIt? Is that a custom function or something that is getting the $mySite data from $_GET or $_POST? Can you paste the code for that?
     
    jsamdirect, Jun 3, 2009 IP
  3. James Barcellano

    James Barcellano Active Member

    Messages:
    114
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    
    if (getIt($mySite) == "0") {
        echo "<img src=0.jpg>";
    } elseif (getIt($mySite) == "1") {
        echo "<img src=1.jpg>";
    } else {
        echo "<img src=2.jpg>";
    }
    
    PHP:
    Format your code correctly please, also what is getIt()
     
    James Barcellano, Jun 3, 2009 IP
  4. SearchBliss

    SearchBliss Well-Known Member

    Messages:
    1,899
    Likes Received:
    70
    Best Answers:
    2
    Trophy Points:
    195
    Digital Goods:
    1
    #4
    getIt is a custom function...and I'm an ASP coder and new to PHP so thanks for the format correction...I need it.
     
    SearchBliss, Jun 3, 2009 IP