Thursday, March 12, 2009

Exercise 6: Some server practice with PHP

1. In this exercise with can call up and examine some environment variables on the server. The code below has the UNIX environment variable for storing your remote Internet address. UNIX environment variable are recognised by the use of upper case letters. Try the same code by replacing with $REMOTE_ADDR $SERVER_NAME, or $PHP_SELF

The result screen of $REMOTE_ADDR:
Display the client address on screen


The result screen of $SERVER_NAME:
Display server address (as the server and the client are in the same machine, the address of them are the same) on screen


The result screen of $PHP_SELF:
Display the file name of the php program on screen


2. Create a web application called "hello_world.php" which contains in the body:

The result screen of "hello_world.php":

No comments:

Post a Comment