RE: [PHP] RE: [newbie] embed php in html file
| From: | Matt Schroebel | Date: | Thu, 03 Apr 2003 16:32:28 +0000 |
| Subject: | RE: [PHP] RE: [newbie] embed php in html file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-142170@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Bobby Rahman [mailto:bobby_rahman2002@hotmail.com]
> Sent: Thursday, April 03, 2003 11:25 AM
> To: php-general@lists.php.net
> 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