-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit.php
More file actions
27 lines (26 loc) · 734 Bytes
/
submit.php
File metadata and controls
27 lines (26 loc) · 734 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
25
26
27
<?php
require_once "config.php";
if ($_SERVER['REQUEST_METHOD'] == "POST"){
$username=trim($_POST['username']);
$password=trim($_POST['password']);
$sql="select * from users where username='$username' and password='$password'";
$result=mysqli_query($conn,$sql);
$count= mysqli_num_rows($result);
if($count){
while($row = mysqli_fetch_assoc($result)){
session_start();
$_SESSION['accountno']=$row['accountno'];
$_SESSION['name']=$row['name'];
$_SESSION['bal']=$row['bal'];
}
header("location: welcome.php");
}
else{
echo "<script type='text/javascript'>";
echo "alert('Oops! please Enter valid username or password ');
window.location='index.php';
echo </script>";
}
mysqli_close($conn);
}
?>