Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once('DbConn.php');
- include_once('Users.php');
- $response="";
- $db= new DBConn();
- if (isset($_POST['user']) && isset($_POST['pass'])) {
- if (CheckCredentials()) {
- $response="Log In Succesful";
- Redirect();
- }
- else{
- $response="User No exists";
- }
- }
- else {
- $response= "No Button Clicked";
- }
- echo $response;
- function CheckCredentials(){
- $Users= new User();
- $user=$_POST['user'];
- $pass=$_POST['pass'];
- return $Users->CheckCredentials($user,$pass);
- }
- function UserExist(){
- $Users= new User();
- $user=$_POST['user'];
- return $Users->UserExists($user);
- }
- function Redirect(){
- $page="http://localhost:8080/Projects/Pentalog/Mod2Tema2/signIn.html";
- header('Location: '.$page);
- exit;
- }
- function GenerateToken(){
- $token="";
- if (CheckCredentials())
- {
- $token= md5($_POST['user'].$_POST['pass']);
- }
- return $token;
- }
- ?>
Add Comment
Please, Sign In to add comment