Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $con=mysql_connect('localhost','root','');
- if(!$con){
- header('Location: index.php?msg=Αποτυχημένη σύνδεση στη βάση δεδομένων!');
- }
- $db=mysql_select_db('usedcars',$con);
- if(!$db){
- header('Location: index.php?msg=Αποτυχημένη σύνδεση στη usedcars!');
- }
- $username = $_POST['username'];
- $password = $_POST['password'];
- $query=mysql("SELECT * FROM `USERS` WHERE `USERNAME`='$username' AND `PASSWORD`='$password'");
- $result=mysql_query($query);
- $count=mysql_num_rows($result);
- if($count==1){
- $_SESSION['username']=$username;
- header('Location= logged_in_page.php');
- }
- else{
- header('Location: index.php?msg=Αποτυχημένη σύνδεση! Γραμμές:'.$count.'!!');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement