Jump to content

server variable and php_self


garry27

Recommended Posts

i've tried to use the php self a number of times but i can never get it to work. here, i'm trying to say if the current executable is called index.php then ...

[code]$_SERVER['PHP_SELF'] !== 'index.php'[/code]

the function that's calling it is in a folder called php_functions in the root directory and index.php is in the root

Link to comment
https://forums.phpfreaks.com/topic/35112-server-variable-and-php_self/
Share on other sites

Actually $_SERVER['PHP_SELF'] would return just the filename with no querystring...

i.e.

http://www.yourdomain.com/index.php

It will return '/index.php';

this will help you with your server variables.

[code=php:0]
<?php
echo "<pre>";
print_r($_SERVER);
echo "</pre>";
?>
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.