php produces blank page

Discussion in 'PHP' started by samvincent08, Oct 9, 2010.

  1. #1
    Here is a small code that isnt producing any content on the page: Actually all these three blocks go together and i have wrapped with tags for highlighting purpose. If I use a php date display function, it displays the date and also the query run on DB is producing the correct result. But why isnt it display the output on the screen?

    <html>
    <head>
        <title>index</title> 
        <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
    </head>
    <body id="BODY1"><?php echo  @$arr_Result1[''] ?><p id="P1"><?php echo  @$arr_Result1[''] ?></p>
    </body>
    </html>
    HTML:
    SOLVED :)
     
    Last edited: Oct 9, 2010
    samvincent08, Oct 9, 2010 IP
  2. JoelLarson

    JoelLarson Peon

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's not displaying output because there aren't any valid PHP variables being echo'd.

    <body id="BODY1"><?php echo  @$eg_Result1[''] ?><p id="P1"><?php echo  @$eg_Result1[''] ?></p>
    Code (markup):
    If you remove the @ in front of both variables, it should throw an error due to it retrieving a null key ( [''] ).
     
    JoelLarson, Oct 9, 2010 IP
  3. ActiveFrost

    ActiveFrost Notable Member

    Messages:
    2,072
    Likes Received:
    63
    Best Answers:
    3
    Trophy Points:
    245
    #3
    You forgot semicolons.
     
    ActiveFrost, Oct 10, 2010 IP
  4. JoelLarson

    JoelLarson Peon

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If it's one line of code, they're not required, but recommended.
     
    JoelLarson, Oct 10, 2010 IP