-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsendmsg.php
More file actions
81 lines (71 loc) · 1.69 KB
/
Copy pathsendmsg.php
File metadata and controls
81 lines (71 loc) · 1.69 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html>
<head>
<title>New Booking</title>
</head>
<body>
<h1>Search Doctor</h1><br>
<form method="post" action="">
Category:
<select name="category" required>
<?php
$lin=mysqli_connect("localhost","root","");
mysqli_select_db($lin,"registration");
$res=mysqli_query($lin,"SELECT DISTINCT category FROM doctor");
while($row=mysqli_fetch_array($res))
{
?>
<option><?php echo $row['category'];?></option>
<?php
}
?>
</select><br><br>
<button type='submit' name='check'>Check</button><br>
</form>
<?php
session_start();
$var=$_SESSION['username'];
mysql_connect("localhost","root","");
mysql_select_db("registration");
if(isset($_POST['check']))
{
$var=$_SESSION['username'];
$searchterm=mysql_real_escape_string(trim($_POST['category']));
$find=mysql_query("SELECT * FROM doctor WHERE category LIKE'$searchterm' ");
while($row=mysql_fetch_assoc($find))
{
$diseases=$row['did'];
$name1=$row['dname'];
$name2=$row['dadress'];
$name3=$row['dmobile'];
$name4=$row['category'];
$name5=$row['day'];
$name6=$row['time'];
//$name7=$row['Rating'];
echo "<table cellspacing='50' cellpading='400' width='700' display:block>
<tr>
<th><u>Doctor Id</u></th>
<th><u>Name</u></th>
<th><u>Adress</u></th>
<th><u>Phone no.</u></th>
<th><u>Specalist</u></th>
<th><u>Days</u></th>
<th><u>Time</u></th>
<th><u>Send Message</u></th>
</tr>
<tr>
<td>$diseases</td>
<td>$name1</td>
<td>$name2</td>
<td>$name3</td>
<td>$name4</td>
<td>$name5</td>
<td>$name6</td>
<td><a href=chat1.php?did=".$row['did'].">Send Message</a></td>
</tr>
</table>";
}
}
?>
</body>
</html>