Skip to content

Instantly share code, notes, and snippets.

@satouriko
Created August 19, 2017 15:38
Show Gist options
  • Save satouriko/53e4702ffa944b93bb6ca6f36718ebe3 to your computer and use it in GitHub Desktop.
Save satouriko/53e4702ffa944b93bb6ca6f36718ebe3 to your computer and use it in GitHub Desktop.
php_with_session
<?php
session_start();
$_SESSION['error'] = "Error!!!";
header("Location: index.php");
<?php
session_start();
if(isset($_SESSION['error'])) {
echo $_SESSION['error'];
unset($_SESSION['error']);
}
?>
<form action="handle.php" method="post">
<input type="submit" value="submit">
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment