Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "top.php";
- include "connect.php";
- $admin_username=$_POST['admin_username']; // Gets the inputted username from the form
- $admin_password=$_POST['admin_password']; // Gets the inputted password from the form
- $time=time(); // Gets the current server time
- print_r($admin_username.' - '.$admin_password);
- $query="SELECT * FROM admin WHERE username='".$admin_username."' AND password='".md5($admin_password)."'";
- $result=mysql_query($query,$connect);
- //row=mysql_fetch_array($result,MYSQL_ASSOC);
- print_r($query);
- if (mysql_num_rows($result)) // If the username and password are correct do the following;
- {
- $_SESSION['admin_loggedin']=1;
- setcookie("eBazar[admin_username]",$admin_username,0); // Sets the cookie username
- setcookie("eBazar[admin_password]",$admin_password,0); // Sets the cookie password
- exit();
- }
- else // If login is unsuccessful forwards the user back to the index page with an error
- {
- header('Location: spravca_index.php');
- exit();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement