Sebastian Becker: Adresszeile auslesen

Beitrag lesen

Hallo,

Kann man mit PHP die Adresszeile des Browsers auslesen?
Und wenn ja wie?

Auslesen geht wohl nicht - aber man kann die aktuelle URL bestimmen, die ja normalerweise in der Adresszeile des Browsers angezeigt wird bzw. deren Bestandteile. Ich zitiere von http://www.php.net:

PHP_SELF
The filename of the currently executing script, relative to the document root.

array parse_url (string url)
This function returns an associative array returning any of the various components of the URL that are present.

This includes the
scheme - e.g. http://
host
port
user
pass
path
query - after the question mark ?
fragment - after the hashmark #

Grüße, Sebastian