NYCPHP Meetup

NYPHP.org

[nycphp-talk] IIS: $_SERVER & referer

Hans Zaunere zaunere at yahoo.com
Mon May 12 18:21:24 EDT 2003


--- "Emmanuel. M. Decarie" <emm at scriptdigital.com> wrote:
> PHP Version 4.2.2
> Windows NT 5.0
> 
> Hello,
> 
> I'm working for a client that have the configuration above.
> 
> It seems that the $_SERVER global is not created and so I can't use 
> for example $_SERVER['PHP_SELF ']. No big deal since I can get the 
> same info with getenv('SCRIPT_NAME').

What about getenv('PHP_SELF');  or print_r($_SERVER); or var_dump($_SERVER); 
any sign of PHP_SELF?

> I can ask the client to make modifications to the server php.ini and 
> I was wondering if there is something to do there.
> 
> I had a look here, but don't see any answers.
>
<http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server>

Perhaps a variables_order issue?

> Also, I'd like to find a way to get the referer. $_ENV is not 
> available (variables_order doesn't contains 'E' in php.ini) but I 
> doubt its a solution since I did some test with Perl listing all the 
> environment variable and there is no referer variable that I can see.
> 
> I tried that in Perl:
> 
> #! perl -w
> 
> use CGI ':standard';
> 
> print header ('text/plain');
> foreach $k (keys %ENV) {
> 	print "$k = $ENV{$k}\
";
> }
> 
> and this (with CGI.pm): referer ().
> 
> without results.
> 
> The CGI Environment Variables defined on the following page doesn't 
> seems to list a way to get the referer so I don't see how I could use 
> getenv for that.
> <http://hoohoo.ncsa.uiuc.edu/cgi/env.html>

The referer should be set; that is if the browser sent it previously.  I'm on
shakey ground here with IIS, but perhaps an upgrade of PHP (especially
concerning IIS, as I think there's been a lot of improvements in the
multithreaded environments).  A check that IIS isn't configured strangely,
too?

H





More information about the talk mailing list