Posted by kOld on Tue 26th Sep 11:32
download | new post
- <?
- if($_GET['p']=='logout'){
- exit;
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Untitled Document</title>
- </head>
- <body>
- <?
- if($_POST['login']=='hake' and $_POST['password']=='1coisakk'){
- $_SESSION['user']=$_POST['login'];
- echo 'Login efectuado com sucesso.';
- }else{
- echo 'Login ou password errados.';
- }
- }
- ?>
- <?
- if($_SESSION['user']==''){
- ?>
- <form id="form1" name="form1" method="post" action="">
- Login:
- <input name="login" type="text" id="login" />
- <br />
- Password:
- <input name="password" type="text" id="password" />
- <br />
- <input name="Login" type="submit" id="Login" value="Login" />
- </form>
- <?
- }else{
- ?>
- Bem vindo user <?=$_SESSION['user']?>, <a href="sessoes.html?p=logout">logout</a>
- <?
- }
- ?>
- </body>
- </html>
Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.