problem with echo ....

Discussion in 'PHP' started by 143.3, Jun 23, 2010.

  1. #1
    hi , i just started coding today , and i am stuck with echo ...
    i ve installed php today itself

    when i type nd run this code -
    
    
    <html>
     <head>
     </head>
     <body>
     <p>Static Text</p>
    <?php
    echo '<p>This text was generated by PHP!</p>';
    ?>
    
     </body>
    </html>
    PHP:
    i get output as

    Static Text
    This text was generated by PHP!

    '; ?>


    why i am getting closing semicolon and tag as output ,
    please guide .... also if i remove <p> tag i got nothing in output

    thanks
     
    143.3, Jun 23, 2010 IP
  2. thomasdgr

    thomasdgr Active Member

    Messages:
    167
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #2
    In order to run php pages locally on your pc you must install and configure apache (or something similar) and php. Do a google search to learn more...
    Another way is to upload your files on a free host and test them there.
     
    thomasdgr, Jun 23, 2010 IP
  3. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #3
    PHP does'nt seem enabled or misconfigured.

    You can use XAMPP for your localhost they supply an auto installer.
     
    danx10, Jun 23, 2010 IP
  4. getlandersgetpaid

    getlandersgetpaid Guest

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    XAMPP is a must have for beginner programmers. It also has a link to a phpinfo() page so you see how your PHP is set up. Although out of the box is fine for most folks.

    If you dont fancy installing XAMPP you can just create a file with the following code in, and it will render a page with all of your PHP.ini files in it.

    <?php echo phpinfo();?>

    See how you get on.
     
    getlandersgetpaid, Jun 23, 2010 IP
  5. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #5
    Run this in FireFox and Show me the output :)
     
    roopajyothi, Jun 23, 2010 IP
  6. SwedBo

    SwedBo Peon

    Messages:
    77
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You haven't installed it correctly .. Which tutorial / manual did you follow ?
     
    SwedBo, Jun 23, 2010 IP