Guest User

Untitled

a guest
Dec 10th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.75 KB | None | 0 0
  1. <?php
  2.         require_once("functions.php");
  3.  
  4.                 $username = $_POST['username'];
  5.                 $passwd = $_POST['passwd'];
  6.                 $password = checkPassWd($passwd, $username);
  7.  
  8.                 echo $password;
  9.                 echo $username;
  10.  
  11.         if($_POST['credentials']) {
  12.                 if(!empty($password) && !empty($username)) {
  13.                         if($password == FALSE) {
  14.                                 echo "vaara salasana";
  15.                                 die();
  16.                         }
  17.                         else {
  18.                                 session_start();
  19.                                 $_SESSION['username'] = $username;
  20.                         }
  21.                 }
  22.                 else {
  23.                         echo "tarkista, etta salasanasi ja kayttajatunnuksesi ovat oikein";
  24.                 }
  25.         }
  26.         if(isset($_SESSION['username'])){
  27.                 ?>
  28.                 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  29.                 <html>
  30.                 <head>
  31.                 <title>Fongaus</title>
  32.                 <link rel="stylesheet" type="text/css" href="styles.css" />
  33.                 </head>
  34.                 <body>
  35.                         <h2>Tervetuloa!</h2>
  36.                 <?php
  37.                         if($_GET['setPage']) {
  38.                                 LoadPage($setPage);
  39.                         }
  40.                         else {
  41.                                 require_once("index.php");
  42.                         }
  43.                 ?>
  44.                 </body>
  45.                 </html>
  46.                 <?php
  47.         }
  48.         else {
  49.                 require_once("templates/login.php");
  50.         }
  51. session_destroy();
  52. mysql_close($link);
  53. ?>
Add Comment
Please, Sign In to add comment