The USA Linux Users Group Paste Bin

  • el
  • pt
  • This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

    The USA Linux Users Group Paste Bin

    Posted by kOld on Tue 26th Sep 11:32
    download | new post

    1. <?
    2. if($_GET['p']=='logout'){
    3.   header('Location: ./sessoes.html');
    4.   exit;
    5. }
    6. ?>
    7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    8. <html xmlns="http://www.w3.org/1999/xhtml">
    9. <head>
    10. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    11. <title>Untitled Document</title>
    12. </head>
    13.  
    14. <body>
    15. <?
    16. if(isset($_POST['login']) and isset($_POST['password'])){
    17.  
    18.   if($_POST['login']=='hake' and $_POST['password']=='1coisakk'){
    19.     $_SESSION['user']=$_POST['login'];
    20.         echo 'Login efectuado com sucesso.';
    21.   }else{
    22.     echo 'Login ou password errados.';
    23.   }
    24.  
    25. }
    26. ?>
    27.  
    28. <?
    29.   if($_SESSION['user']==''){
    30. ?>
    31. <form id="form1" name="form1" method="post" action="">
    32.   Login:
    33.   <input name="login" type="text" id="login" />
    34.   <br />
    35. Password:
    36. <input name="password" type="text" id="password" />
    37. <br />
    38. <input name="Login" type="submit" id="Login" value="Login" />
    39. </form>
    40. <?
    41.   }else{
    42. ?>
    43. Bem vindo user <?=$_SESSION['user']?>, <a href="sessoes.html?p=logout">logout</a>
    44. <?
    45.   }
    46. ?>
    47. </body>
    48. </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.

    Use syntax highlighting

    To highlight particular lines, prefix each line with @@


    Remember my settings