-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrec_reg.php
More file actions
32 lines (23 loc) · 941 Bytes
/
rec_reg.php
File metadata and controls
32 lines (23 loc) · 941 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
28
29
30
31
32
<?php
session_start();
include 'config.php';
if(isset($_POST['rec_signup_submit'])){
mysqli_query($con,"insert into recreg (recname, rec_uname,rec_email,rec_pass,rec_mobile,rec_blood) values('".$_POST["rec_name"]."','".$_POST["rec_uname"]."','".$_POST["rec_email"]."','".$_POST["rec_pass"]."','".$_POST["rec_mobile"]."','".$_POST["rec_blood"]."')");
header('Location:login_new.php');
}
else if(isset($_POST['rec_login_submit'])){
$query_result = mysqli_query($con,"select recname from recreg where rec_uname = '".$_POST["rec_uname"]."' and rec_pass = '".$_POST["rec_pass"]."'");
$row = mysqli_num_rows($query_result);
if($row > 0){
$row = mysqli_fetch_array($query_result);
$_SESSION["name"] = $row['recname'];
header('Location:req_blood.php');
}
else{
echo 'Login failed!';
}
}
else{
echo 'Error reported!';
}
?>