I am trying to get the url so that when a cookie does not exist the argument(URL) is passed to the login page and is captured in a hidden tag. Then upon successful authentication the url is the page that the user will be directed to. I have done the same thing for another website in the past and had no mproblem. The past website was PHP/Apache. But now I am doing an intranet site and they are running PHP/IIS5.0.

The problem is this: When I try to get the $REQUEST_URI (url) it gives me an an error saying that is an undefined variable. I tried several ways and none worked. Can someone please help?

Josu😕

    Run phpinfo() on the site and see what variables that IIS gives you to work with. You'll probably have to build a page to call the phpinfo() page from to get information about $REQUEST_URI. I've never worked with IIS so this is all the help I have.

      In the phpinfo() page the variable that brings the file name( which I am most interested in) is the following variable:
      _SERVER["PHP_SELF"]

      But when I try to use the variable in my code, it gives me the follwoing error:
      Parse Error: parse error, unexpected '[' in c:\inetpub\wwwroot\auroraclientinfo.php on line 16

      The code that I entered was as follows:

      $thefile = "1";
      $thefile = _SERVER["PHP_SELF"];

      Is there something worng with what I am doing from what you can see?

      Thanks in advance for your help.
      Josu

        "_SERVER["PHP_SELF"]"?

        It's $_SERVER['PHP_SELF'] if you have PHP 4.1 and
        $HTTP_SERVER_VARS['PHP_SELF'] if you have an earlier PHP.

        Just be safe...

        $request_uri = $HTTP_SERVER_VARS['REQUEST_URI'];
        $php_self = $HTTP_SERVER_VARS['PHP_SELF'];
        
        echo "This page, ".$php_self." was requested by: ".$request_uri;
          Write a Reply...