program is not giving any output

Discussion in 'PHP' started by kharearch, Jan 10, 2008.

  1. #1
    I am running following program. It is not giving any output. Please solve the error.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <?php
    $movie = <<<EOD
    <h2><center>Movie Review Database</center></h2>
    <table width='70%' border='1' cellpadding='2'
    cellspacing='2' align='center'>
    <tr>
    <th>Movie Title</th>
    <th>Year of Release</th>
    <th>Movie Director</th>
    <th>Movie Lead Actor</th>
    <th>Movie Type</th>
    </tr>
    </table>
    EOD;
    ?>
    </body>
    </html>
     
    kharearch, Jan 10, 2008 IP
  2. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #2
    You need to echo it...
     
    Kaizoku, Jan 10, 2008 IP
  3. junandya

    junandya Member

    Messages:
    79
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    Hello,

    i dont know what you trying to do, but may be it helps if you want to try to show the table inside your php script

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    <?php
    $movie = "something";
    echo "
    <h2><center>Movie Review Database</center></h2>
    <table width='70%' border='1' cellpadding='2'
    cellspacing='2' align='center'>
    <tr>
    <th>Movie Title</th>
    <th>Year of Release</th>
    <th>Movie Director</th>
    <th>Movie Lead Actor</th>
    <th>Movie Type</th>
    </tr>
    </table>
    ";
    ?>
    </body>
    </html>
    PHP:

    :D
     
    junandya, Jan 10, 2008 IP
  4. WeBuster

    WeBuster Member

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #4
    I don't think you should use EOD for this little output.
    EOD is a soultion to organize your code (If you have too many echos in it).
     
    WeBuster, Jan 10, 2008 IP