Connecting Tech Pros Worldwide Help | Site Map

Variable Behavior

 
LinkBack Thread Tools Search this Thread
  #1  
Old April 11th, 2007, 06:45 AM
Mitul
Guest
 
Posts: n/a
Default Variable Behavior

Hello Friends,

_SERVER["SCRIPT_NAME"] /phpinfo.php

_SERVER["PHP_SELF"] /phpinfo.php


======
Above variables return same value... current file name. then wat's
difference?? Please let me know.

Thanks in advance.


  #2  
Old April 11th, 2007, 10:45 AM
SUtrap
Guest
 
Posts: n/a
Default Re: Variable Behavior

http://de.php.net/reserved.variables
Quote:
_SERVER["SCRIPT_NAME"] /phpinfo.php
It's the path for the actual script.
'SCRIPT_NAME'
Contains the current script's path. This is useful for pages which
need to point to themselves. The __FILE__ constant contains the full
path and filename of the current (i.e. included) file.
Quote:
_SERVER["PHP_SELF"] /phpinfo.php
'PHP_SELF'

The filename of the currently executing script, relative to the
document root. For instance, $_SERVER['PHP_SELF'] in a script at the
address http://example.com/test.php/foo.bar would be /test.php/
foo.bar. The __FILE__ constant contains the full path and filename of
the current (i.e. included) file.

If PHP is running as a command-line processor this variable
contains the script name since PHP 4.3.0. Previously it was not
available.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.