You are here: Re: [PHP] Mixed PHP/SSI and environment variables « PHP « IT news, forums, messages
Re: [PHP] Mixed PHP/SSI and environment variables

Posted by Jochem Maas on 10/19/52 11:30

Christoph Freundl wrote:
> Hello,
>
> I have a problem with the persistence of environment variables when
> mixing PHP and SSI (Apache) and I am not sure if I just made an error
> or if this approach cannot work at all.
> So please consider the following files:
>
> setvar.shtml
> -------------------------------------------------
> <!--#set var="myvar" value="myval" -->
> -------------------------------------------------
>
> showvar.php
> -------------------------------------------------
> <?php echo apache_getenv( "myvar" ); ?>
> -------------------------------------------------
>
> info.shtml
> -------------------------------------------------
> <!--#include virtual="setvar.shtml" -->
> <!--#include virtual="showvar.php" -->
> -------------------------------------------------
>
> info.php
> -------------------------------------------------
> <?php
> virtual( "setvar.shtml" );

have yuou tried include/require here instead of virtual()

I imagine that the env of the subprocess wouldn't affect
the env of the parent process - i.e. to me it makes sense
if you say the env var in the subprocess is not available in
the parent process.

> echo apache_getenv( "myvar" );
> ?>
> -------------------------------------------------
>
> What I would expect is that you get the same result if you call
> info.shtml and info.php. What happens when I tried (PHP 4.3.10 with
> both Apache 1.3.33 and 2.0.53): the shtml shows the variable but the
> php does not, it seems to "forget" the variable set in setvar.shtml.
> Please, can anybody tell me what is going wrong here?
>
> Regards, Christoph
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация