RE: [newbie] embed php in html file
| From: | Bobby Rahman | Date: | Thu, 03 Apr 2003 16:24:37 +0000 |
| Subject: | RE: [newbie] embed php in html file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-142167@lists.php.net to get a copy of this message | ||
Hiya
I need advice for an optimum solution to display the username that is logged in on every html form page of my application.
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>";
?>
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.The reason I am so keen on keeping html and php files seperate is thus to make debugging easier and maintain a kinda three tier design.
Any suggestions will be much appreciated
Bob
_________________________________________________________________
Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger