Forum Moderators: coopster

Message Too Old, No Replies

auto_prepend-ed files

how to pass variables?

         

coyote

7:34 am on Mar 10, 2004 (gmt 0)

10+ Year Member



I'm overhauling my site to make it template-driven without so many
includes()
.

I have the following in .htaccess to prepend the header file:

<IfModule mod_php4.c> 
php_value auto_prepend_file "/path/to/top.php"
</IfModule>

Example of contents of top.php:

<html><head><title><? print("$_POST[t]");?></title>(stylesheet, etc.)</head><body>(logo and stuff)

Example contents of a-test-page.php:
<? $t='page title';?>

When I run a-test-page.php, the title is blank. I've tried troubleshooting

$_POST
in various ways, all either result in no title or parse error.

Any suggestions?

coopster

6:37 pm on Mar 10, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



auto_prepend_file specifies the name of a file that is automatically parsed before the main file. Unless you are posting a form with an input element named "t", the title will always be blank. Make sense?