Re: newbie php tutorial question

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

 



On Sun, October 1, 2006 1:27 pm, 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
>
> '; ?>
> ----------------

You didn't configure httpd.conf correctly with some combination of
AddModule/LoadModule/AddType/Action/Handler directives.
[You don't need *all* of those, just the ones you need for whichever
way you are trying to install PHP.]

So what happens is that the browsers "sees" your PHP source.
<?php echo '<p>  turns into some '?php' tag the browser doesn't know
about, so it just ignores it.
</p> turns into a paragraph closing tag.
And ; ?> is just bad HTML.

Use "View Source"

And, while you're at it, get Firefox and the HTML Validator extension
to to Firefox (aka Tidy)

Then train yourself to keep an eye on that bottom-right corner where
you see if your HTML is "good" or not.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
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