Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title> My Test Form </title>
- </head>
- <body>
- <?php
- if (!isset($_SESSION['userid'])) {
- print "<form action = " . $_SERVER['PHP_SELF'] . " method = \"POST\"><br>";
- print "user: <input type=text name='userid'><br>";
- print "pass: <input type=text name='id'><br>";
- print "<input type=submit name='submit' value='submit'><br>";
- }
- elseif (!empty($_POST)) {
- $_SESSION['userid'] = $_POST['userid'];
- $_SESSION['id'] = $_POST['id'];
- print "foo";
- }
- else {
- print "You are logged in: " . print_r($_SESSION, TRUE);
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement