Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require 'config.php';
- $db = sqlite_open('data.php');
- //
- $Username = sqlite_escape_string(stripslashes($_POST['user']));
- $Password = (sqlite_escape_string(stripslashes($_POST['pass'])));
- $query = "SELECT * FROM data WHERE user = '$Username' AND password = '$Password'";
- if($Username == "")
- {
- echo "Whoops... looks like you forgot your name!";
- echo "$Username";
- exit();
- }
- if ($password == "")
- {
- echo "Uhm.. You forgot to enter your password!";
- header('Refresh: 4; url=login.php');
- exit();
- }
- sqlite_query($db,$query);
- if ($query == true)
- {
- echo "Thanks for logging in, Our System will redirect you shortly.";
- @session_start();
- @$_SESSION['User'] = $Username;
- header('Refresh: 4; url=index2.php');
- exit();
- }
- else
- {
- echo "<p>You may have entered an incorrect username and or password.<br /><a href=\"login.php\">Redirect Me</a></p>";
- header('Refresh: 4; url=login.php');
- exit();
- }
- ?>
Add Comment
Please, Sign In to add comment