Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $hostname = 'hostname';
- $dbname = 'dbname';
- $username = 'username';
- $password = 'password';
- $con=mysql_connect($hostname,$username,$password) or die("Failed to connect to MySQL: " . mysql_error());
- $db=mysql_select_db($dbname,$con) or die("Failed to connect to MySQL: " . mysql_error());
- $myusername = $_POST['username'];
- $mypassword = $_POST['password'];
- $myusername = stripslashes($myusername);
- $mypassword = stripslashes($mypassword);
- $query = "SELECT * FROM Client_Information WHERE Username='$myusername' and Password='$mypassword'";
- $result = mysql_query($query);
- $count = mysql_num_rows($result);
- mysql_close();
- if($count==1){
- $seconds = 5 + time();
- setcookie(loggedin, date("F jS - g:i a"), $seconds);
- header("location: login_success.php");
- if ($myusername['idClients'] == '#') {
- header("Location: admin.php");
- }
- }else{
- echo '<div class="incorrect">- Incorrect username or password -</div>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement