> -----Original Message-----
> From: Bobby Rahman [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 03, 2003 11:25 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] RE: [newbie] embed php in html file
> 
> I have a header.php :
> <?
> session_start();
> echo "<BR><font face=\"Verdana\"><font 
> color=\"red\"size=\"3\">Logged in as: 
> ".$_SESSION['curr_user']."<BR></font><br>";
> ?>

Not your question, but in case you don't know the syntax of arrays in
double quotes, you can also write that as:
echo "<BR><font face=\"Verdana\"><font color=\"red\"size=\"3\">Logged in
as: {$_SESSION['curr_user']}<BR></font><br>";

> 
> Now I have many html forms which user's see
> What I want to know is how to include the header.php into 
> every html form 
> page.
> 
> One way is to rename the html file with extension .php
> then
> <?
> require_once("header.php")
> ?>
> 
> This seems a bit wasteful for one line of php to change all 
> the forms to 
> .php. Is there any other ways of embedding the header.php 
> file in html 
> forms.

Take a look at auto_prepend.  You'll need to change the config to parse
the file, so you might want to name the pages with the user name .htm,
and parse .htm as a php file.

http://www.php.net/manual/en/configuration.directives.php#AEN2371

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

Reply via email to