Hallo
http://aktuell.de.selfhtml.org/tippstricks/php/loginsystem/index.htm
hier versteh ich folgenden code in auth.php nicht:
header('Location: http://'.$hostname.($path == '/' ? '' : $path).'/login.php');
das ganze script geht so:
session_start();
$hostname = $_SERVER['HTTP_HOST'];
$path = dirname($_SERVER['PHP_SELF']);
if (!isset($_SESSION['angemeldet']) || !$_SESSION['angemeldet']) { //Überprüfung bestehender account angemeldet ist
header('Location: http://'.$hostname.($path == '/' ? '' : $path).'/login.php');
exit;
}
im PHPHandbuch steht ähnliches z. B:
header("Location: http://".$_SERVER['HTTP_HOST']
.dirname($_SERVER['PHP_SELF'])
."/".$relative_url);
welche Aufgabe hat denn jetzt
($path == '/' ? '' : $path)
und wie muß man den befehl verstehen?
Grüße von mir carsten