Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("functions.php");
- if($_POST['credentials']) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- if(!empty($password) && !empty($username)) {
- if(checkPassWd($password, $username) == FALSE) {
- echo "<div class=\"login\"><p style=\"color: red\">Väärä salasana</p></div>";
- }
- else {
- session_start();
- $_SESSION['username'] = $username;
- }
- }
- else {
- echo "<div class=\"login\"><p style=\"color: red\">Anna käyttäjätunnuksesi ja salasanasi.</p></div>";
- }
- }
- if(isset($_SESSION['username'])){
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html>
- <head>
- <title>Fongaus</title>
- <link rel="stylesheet" type="text/css" href="styles.css" />
- </head>
- <body>
- <a href="index.php?setPage=1">Etusivu</a>
- <a href="index.php?setPage=2">Linkki2</a>
- <?php
- if($_GET['setPage']) {
- LoadPage($setPage);
- print_r($_SESSION);
- }
- else {
- require_once("templates/etusivu.php");
- }
- ?>
- </body>
- </html>
- <?php
- }
- else {
- require_once("templates/login.php");
- }
- mysql_close($link);
- ?>
Add Comment
Please, Sign In to add comment