--- cowfeety <[EMAIL PROTECTED]> wrote:

> i'm trying to create my 1st php page. my php codes are contained in a
> different folder separated from my html codes. 
> 
> i'm trying to do the 'hello world' but without luck. below is the php
> code. i can write anything in my html page but any php syntax will not
> work. 
> 
> example: if i write
> 
>         echo 'hello world';
> 
> in the same php file the 'hello world' get printed on top of my
> header. if i write 
> 
>        <?php echo 'hello world'; ?>
> 
> in my html file nothing happens. 
> 
> PLEASE HELP! THANK YOU!!!

The configuration of the web server (eg Apache, httpd.conf) determines which
filename extensions are passed to the PHP module.  Normally the one extension
listed is .php only.  Although you could add additional extensions (eg .html)
it is usually not a good idea since your next server may not give you that
control.

Your .php files can contain HTML and usually do.  There is no special need to
separate PHP and HTML code in a separate folder.  If you do so, you will have
to give the relative paths in links for each file, of course.

Remember that since PHP is processed by the web server module, you have to
request the pages through the web server.  On a development environment on your
own computer this is often achieved by using http://localhost/scriptname.php
where scriptname.php is a file in the main web directory defined for the
browser.

James


James

Reply via email to