Files from 25-03-26 and added missing Files
This commit is contained in:
32
Zweites Jahr/sessions/session_4.php
Executable file
32
Zweites Jahr/sessions/session_4.php
Executable file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Sessions in PHP: Schritt 4</title>
|
||||
</head>
|
||||
<h1>Sessions in PHP</h1>
|
||||
<h2>Schritt 4</h2>
|
||||
<body>
|
||||
<?php
|
||||
session_start(); //Eine Sitzung beginnen
|
||||
$sId=session_id(); //Auslesen der SessionID
|
||||
|
||||
echo "SID: $sId<br>";
|
||||
|
||||
//Session beenden
|
||||
session_destroy();
|
||||
$sId = session_id();
|
||||
echo "SID nach destroy: $sId<br>";
|
||||
|
||||
echo "<p>Nach session_destroy() sind die Werte weg: </p>";
|
||||
echo "Vorname: $_SESSION[vorname]<br>";
|
||||
echo "Nachname: $_SESSION[nachname]<br>";
|
||||
echo "Alter: $_SESSION[alter]<br>";
|
||||
|
||||
echo "<a href ='session_1.php'><br>zurück zum Anfang</a>";
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user