Still working on my first Windows deployment of a PHP site...

All my instances of $_SERVER['PHP_SELF'] are coming back with an echo.

E.g. what should be
/dev/admin/about-us.php

is instead displaying as
/dev/admin/about-us.php/dev/admin/about-us.php

Which obviously isn't going to work.

Any idea what's going on?

    No, not without seeing how this is happening. Are you saying that the script

    <?php
    echo $_SERVER['PHP_SELF'];
    ?>
    

    does this?

      Yep - echoing $_SERVER['PHP_SELF']

      I did a print_r on $_SERVER and discovered that SCRIPT_NAME was giving me what I wanted - both on the Windows server and my local OS X machine, so I just replaced PHP_SELF with SCRIPT_NAME globally for this site.

      Still, it's weird.

        bunner bob wrote:

        Yep - echoing $_SERVER['PHP_SELF']

        Even if that is the entire script?

          That is indeed quite odd... what version of PHP are you running? Also, can you paste the output of this:

          <?php
          var_dump($_SERVER['PHP_SELF']);
          ?>

          I realize you've found a workaround, but I think it's quite odd that a PHP-filled variable is going haywire like this...

            Write a Reply...