Re: Redirect Problem

From: Date: Fri, 18 Aug 2000 05:08:07 +0000
Subject: Re: Redirect Problem
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-12404@lists.php.net to get a copy of this message
Richard McLean wrote: > Hi All, > > I have a small redirect problem. I'm currently using a Javascript to > redirect a page through a CGI if someone comes directly to that page. > I'm finding a lot of people seem to have JS turned off, or are using > older browsers that don't support the way I'm doing it. Apart from > that, it works great. > > if( window.location.href == 'http://www.server.com<?php > echo $PHP_SELF; ?>') > { > window.location.href = > 'http://www.server.com/cgi-bin/SoftCart.exe<?php echo > $PHP_SELF; > ?>?E+toolstore'; > } > > I'm trying to adapt this to just using PHP but can't quite work it > out. Part of the problem is SoftCart, as it sends the page to PHP > without a query string, and then parses it itself with a query string. > > Meaning that when I go to: > www.server.com/cgi-bin/SoftCart.exe/phpinfo.htm?E+toolstore > > phpinfo() gives me: > > PHP_SELF /phpinfo.htm > QUERY_STRING > REQUEST_URI /phpinfo.htm > SCRIPT_NAME /phpinfo.htm > > What other mechanisms do I have in PHP to check if the in the URL has > a query string? Is there another server-side way to do this? > Apache has a variable QUERY_STRING look under predefined variables in the php manual, I think this is what you want. Regards Joseph Blythe

« previous php.general (#12404) next »