Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- session_start();
- if(isset($_GET['action']) && $_GET['action'] == "submit") {
- $_SESSION['name'] = $_POST['name'];
- header("location: test.php");
- }
- if(isset($_SESSION['name'])) {
- echo "<h2>Ditt namn: ".$_SESSION['name']."</h2>\n";
- }
- ?>
- <form action="test.php?action=submit" method="post">
- <label for="name">Ditt namn:</label><br />
- <input type="text" name="name" id="name" /><br /><input type="submit" value="Skicka" />
- </form>
Add Comment
Please, Sign In to add comment