php - What's the difference between $_SERVER['PHP_SELF'] and $_SERVER['SCRIPT_NAME']? -



php - What's the difference between $_SERVER['PHP_SELF'] and $_SERVER['SCRIPT_NAME']? -

i have php framework , used $_server['script_name'] optimize portability. way don't need manually configure path anymore.

$this->base_url = str_replace('index.php', '', 'http://'.$_server['server_name'].$_server['script_name']);

but noticed $_server['script_name'] , $_server['php_self'] returns exact same string. so, what's difference? how should take between them?

difference

http://sandbox.phpcode.eu/g/3e38d.php/test

script name absolute path file.

php_self script you're in (along "path" after .php)

it's $_server['server_name'] , $_server['http_host']

http://sandbox.phpcode.eu./g/f5093.php http://sandbox.phpcode.eu/g/f5093.php

spot 1 difference

php apache

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -