|
Posted by Lars Eighner on 06/13/07 17:20
In our last episode,
<1181744890.903868.271210@o11g2000prd.googlegroups.com>, the lovely and
talented rhXX broadcast on comp.lang.php:
> hi,
> i need to begin in php. is there any tutorial to begin? (i started an
> hour ago .....)
> i copied this first example
><html>
><head>
><title> Hello World </title>
></head>
><body>
> Hello, world!
><?php
> echo 'This is my first PHP web page.';
> ?>
></body>
></html>
> and saved as .html file, and when i open it with the browser, it
> appears only the html part, but not php ....
> tks in advance
Browsers should ignore stuff in angle brackets that cannot be identified as
HTML elements. And php is not HTML. PHP is a preprocessor language (among
other things). See: "pre" + "processor." Something has to process it. That
something can be a web SERVER (not a browser) if the server has a php module
and is properly configured. Or it can be php at the command line. You
don't really have an .html document. It is a .php document. It is the
processing that changes it into html that can be rendered by browsers. I am
pretty sure some browsers can be configured to use php (if it is installed)
to preprocess a document before it renders it, but that will often require a
dummy server environment and the browser will have to know the document is
supposed to be php, which it won't when it views the document as a file and
the extension is not .php.
1) Have you installed php on your system?
2) Do you have a web server with a php module?
If the answer is no to both questions, then you are not in the php business.
If 1) is yes, I suggest you start reading the documentation that came with
it.
If you just want to see what is in the document, use view source in your
browser.
--
Lars Eighner <http://larseighner.com/> <http://myspace.com/larseighner>
Countdown: 586 days to go.
Why "War Czar"? That sounds like Imperial Russia!
Call it by the American term: "Fall Guy."
[Back to original message]
|