backup
This commit is contained in:
21
php-s1/workshop6/persistence.php
Executable file
21
php-s1/workshop6/persistence.php
Executable file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
var_dump($_SESSION);
|
||||
|
||||
if (isset($_POST["submit"])) {
|
||||
$name = $_POST["name"];
|
||||
$birthday = $_POST["birthday"];
|
||||
echo $name;
|
||||
echo $birthday;
|
||||
|
||||
if ($name && $birthday) {
|
||||
echo "Welcome $name! You were born on $birthday";
|
||||
$_SESSION["name"] = $name;
|
||||
$_SESSION["birthday"] = $birthday;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Error in Name or Date";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user