Guest User

Untitled

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