forked from Spidyhog/TIS
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsave1.php
More file actions
24 lines (22 loc) · 663 Bytes
/
Copy pathsave1.php
File metadata and controls
24 lines (22 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
$u=$_REQUEST['username'];
$p=$_REQUEST['password'];
require_once('connect.php');
//Connect to MYSQL Server
$con=mysqli_connect($servername,$username,$passwword,$databaseName) or die("Could not connect to server");
//Create Query for operation on database table
$query="Select Username,Password from usercredential where Username='$u'";
//Execute Query
$res=mysqli_query($con,$query) or die('Error in fetching records');
$row=mysqli_fetch_array($res);
if($row[1]==$p)
{
session_start();
$_SESSION['username']=$u;
header('Location:index1.php');
}
else
{
echo"<script>alert('Username or Password Incorrect');window.location='signin.php';</script>";
}
?>