-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhos_reg.php
More file actions
45 lines (35 loc) · 1.09 KB
/
hos_reg.php
File metadata and controls
45 lines (35 loc) · 1.09 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php include 'config.php';
session_start();?>
<?php
// $con = mysqli_connect("localhost","root","","bbsystem");
if(isset($_POST['hos_signup_submit'])){
$name = $_POST["hos_name"];
// echo $name;
$id = $_POST['hos_id'];
// echo $id;
$key = $_POST['hos_key'];
// echo $key;
$add = $_POST["hos_address"];
// echo $add;
$mobile = $_POST['hos_mobile'];
mysqli_query($con,"insert into hos_reg values('$name','$id','$key','$add','$mobile')");
header('Location:login_new.php');
}
else if(isset($_POST['hos_login_submit'])){
$query_result = mysqli_query($con,"select hosname from hos_reg where hos_key = '".$_POST["hos_key"]."' and hos_unique_id = '".$_POST["hos_id"]."'");
//$query = mysqli_query($con,"SELECT hosname FROM hos_reg");
//$row1 = mysqli_fetch_array($query);
$row = mysqli_num_rows($query_result);
if($row > 0){
$row = mysqli_fetch_array($query_result);
$_SESSION["name"] = $row['hosname'];
header('Location:add_blood.php');
}
else{
echo 'Login failed!';
}
}
else{
echo 'Error reported!';
}
?>