Re: newbie php tutorial question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is the code in a file with a .php extension? Is that extension configured to be processed by the PHP interpreter? Are you requesting the page via the web server or just double clicking on the file and viewing it locally?

Your output is what the code would show in a browser without passing through the PHP interpreter. Browsers ignore what they don't understand, thus, they ignore the <?php tag and assumes it ends at the first > in the <p>. From then on, it assumes the rest of the line as plain text, except for the </p> which it renders as a new paragraph . It probably didn't get the opening <p>, since it probably assumed the > was the closing bracket for the <?php, but browsers are designed to carry on and assume things that might be missing so a </p> would make it assume there was a <p> somewhere.

Satyam

----- Original Message ----- From: "Stut" <stuttle@xxxxxxxxx>
To: "srdaniel" <srdaniel@xxxxxxxxxxx>
Cc: <php-general@xxxxxxxxxxxxx>
Sent: Sunday, October 01, 2006 10:49 PM
Subject: Re:  newbie php tutorial question


srdaniel wrote:
I setup Apache 2.2.3.0 and PHP 5.1.6.6.

When I run this PHP file:

----------------
<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo '<p>Hello World</p>'; ?>
 </body>
</html>
----------------

Any ideas why I get this for output?

----------------
Hello World

'; ?>
----------------

Apache has not been set up correctly to run this file as PHP. Have a
look at the installation section of the PHP manual - odds are you'll
find the answer there: http://php.net/install

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux