Forum Moderators: coopster

Message Too Old, No Replies

Passing SSI variables to PHP?

         

jjohnstn

3:32 am on Apr 21, 2004 (gmt 0)

10+ Year Member



I have a web site that I am moving to another server. Old PHP version was 4.3.0, version on the new server is 4.3.2.

On the web site pages I do the following with SSI:

<!--#set var="Code" value="123" -->
<!--#include virtual="/includes/header.php"-->

The HTML pages are being parsed, however the php script header.php will not pick up the variable:

<?
print "Code: $Code";
?>

outputs "Code:" (variable not passed).

This works on the old server, so I suspect that it is a config issue with php.ini..... my gut feeling is that this is a simple thing I've overlooked but any ideas please help.

Thanks in advance.

jatar_k

4:01 am on Apr 21, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



it is possible that it is because register_globals is off on the new server and you need to reference it via the appropriate superglobal array.

I think it may be $_ENV

try this

echo "Code: ", $_ENV['Code'];

see if that works
$_ENV [ca3.php.net]

These variables are imported into PHP's global namespace from the environment under which the PHP parser is running.

I think that's right

jjohnstn

4:10 am on Apr 21, 2004 (gmt 0)

10+ Year Member



Yes, that was it, many thanks!