Sei sulla pagina 1di 1

PHP ASSIGNMENT

Create a simple PHP page which generates one of two things based on the value of
the HTTP_REFERER variable. If that variable is the empty string (not set), simply give a short
message that the user didn't come from anywhere. If it is set, generate an HTML link to return
to wherever you came from. Here is a sample of the desired output file.
If you click on this link, you will get a message that you didnt navigate to this site from
anywhere. But if you embed this link in a web page, and then click on it, you will get a message
with a Click to go back link linking to your previous page.

HTTP_REFERRER is a $_SERVER variable. Its documentation can be found at the link below:
http://www.php.net/manual/en/reserved.variables.server.php

Potrebbero piacerti anche