Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("include/database.php");
- if(isset($_POST['submit'])) {
- connect_bookstore(); // custom function
- $spassword = sha1($_POST['password']);
- $username = $_POST['username'];
- if ( checkpassword($username,$spassword) ) { //custom function
- header('Location:insert.php');
- exit;
- } else {
- $message = "Login failed!";
- }
- }
- ?>
- <?php
- if (isset($message)) {
- echo $message;
- }
- ?>
- <?php
- session_start();
- require_once("include/database.php");
- if(isset($_POST['submit'])) {
- connect_bookstore(); // custom function
- $spassword = sha1($_POST['password']);
- $username = $_POST['username'];
- if ( checkpassword($username,$spassword) ) { //custom function
- header('Location:insert.php');
- exit;
- } else {
- $_SESSION['message'] = "Login failed!";
- header('location: /yourfile.php');
- exit;
- }
- }
- if(isset($_SESSION['message']))
- {
- echo $_SESSION['message'];
- unset($_SESSION['message']);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement