iNET Interactive - Online Advertising Agency
          
   Home    Authors    About    Login    Contact Us
   Search:   
Advanced Search     
  Articles

  ASP (26)
  ASP.NET (19)
  C and C++ (4)
  CFML (2)
  CGI and Perl (16)
  Flash (2)
  Java (7)
  JavaScript (28)
  PHP (92)
  MySQL (13)
  MSSQL (3)
  HTML (34)
  SEO (9)
  Visual Basic (12)
  CSS (13)
  SSI (5)
  XML (12)
  C# (14)

  Developer News

May 12, 2008
Film Makers, Bands and Comedians Welcome on MySpace
About
 
May 12, 2008
Software Engineering for Ajax
WebReference.com
 
May 12, 2008
What is the Head Tag For?
About
 
May 11, 2008
Improving accessibility for motor impaired users
WebDevTips UK
 
May 11, 2008
10 ways to orientate users on your site
WebDevTips UK
 
May 11, 2008
Web Design Clinic - Rros restoration camp 2006
About
 
Courtesy of moreover.com
 
Want to receive new articles via e-mail? Click here!
/Home /PHP /Introduction to PHP

PHP Lesson Two - Variables 

  Views:    25010
  Votes:    4
by James N Hitz 1/23/04 Rating: 

Synopsis:

Lesson 2: takes you into the realm of PHP variables, how they are defined, concatenation and PHP operators.
Pages: firstback1 2 3 4 5 6 7 8 10 forwardlast
The Article

This gives the name of the server host under which the current script is executing.REQUEST_METHOD:Predefined Variables

PHP sports a function called phpinfo(). When called this function answers by giving a comprehsensive list of all Predefined Variables.

Pre-defined variables are variables all-right but they are special variables in that they are defined by PHP during the execution time of any PHP script. These variables are many and varied and largely depend on the server configuration.

The common ones (assuming you are running Apache 1.3.6) are:

SERVER_NAME: This gives the name of the server host under which the current script is executing. 
SERVER_SOFTWARE:  Server identification string, given in the headers when responding to requests.
REQUEST_METHOD:  Which request method was used to access the page; i.e. 'GET', 'HEAD', 'POST', 'PUT'.
QUERY_STRING:  The query string, if any, via which the page was accessed.
DOCUMENT_ROOT: The document root directory under which the current script is executing, as defined in the server's configuration file.
HTTP_REFERER: The address of the page (if any) which referred the browser to the current page. This is set by the user's browser; not all browsers will set this.
REMOTE_ADDR: The IP address from which the user is viewing the current page.
SCRIPT_FILENAME: The absolute pathname of the currently executing script.
PATH_TRANSLATED: Filesystem- (not document root-) based path to the current script, after the server has done any virtual-to-real mapping.
 SCRIPT_NAME: Contains the current script's path. This is useful for pages which need to point to themselves.
 REQUEST_URI: The URI which was given in order to access this page; for instance, '/index.html'. 

A long list this one is but it does not even try to exhaust all the predefined variables. Let's use PHP's phpinfo() function to see all the pre-defined variables in your server.

Pages: firstback1 2 3 4 5 6 7 8 10 forwardlast

Similar/related articles:


 
  Sponsors