-
Notifications
You must be signed in to change notification settings - Fork 0
/
searchname1.php
114 lines (82 loc) · 2.7 KB
/
searchname1.php
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
session_start();
extract($_POST);
if (isset($_SESSION[admin]))
{
require("main1.php");
}
else{
require("main.php");
}
?></body><head>
<script type="text/javascript">
function showmenu(elmnt)
{
document.getElementById(elmnt).style.visibility="visible"
}
function hidemenu(elmnt)
{
document.getElementById(elmnt).style.visibility="hidden"
}
</script>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
function verify()
{
var cname;
with(window.document.form1)
{
cname = searchname;
}
if(cname.value == '')
{
alert('Please enter your name');
cname.focus();
return false;
}
}
</script>
<div class="fixed"><div class="title" align="center">Search Name</div>
<form action = "/searchname1.php" method="post" name="form1" class="menu" id="form1">
<div class="content"><div class='menu'>
<input name="searchname" type="text" class="searchall" id="searchname" size="25" maxlength="200" /></div><div class='menu'> <input name="Search" type="submit" class="menu" id="Search" value="Search" onclick="verify();">
</div></div> </form></div>
<?php
$searchname=$_POST['searchname'];
if($searchname =='')
{
echo 'No Result found please try again';
return false;
}
//echo $searchname;
include("student.php");
$Query="SELECT * from student where full_name LIKE '%$searchname%' order by full_name ";
$dbresult=mysql_query($Query);
if(mysql_num_rows($dbresult) >0)
{
while($row=mysql_fetch_row($dbresult))
{
echo "<div class='fixed'><div class='title' align='center'>Search Result"."</div>";
echo "<div class='menu'>Name : "."$row[0]"."</div>";
echo "<div class='menu'>Register Number : "."$row[1]"."</div>";
echo "<div class='menu'>Date of Birth : "."$row[4]"."</div>";
echo "<div class='menu'>Gender : "."$row[5]"."</div>";
echo "<div class='menu'>Blood Group : "."$row[6]"."</div>";
echo "<div class='menu'>Branch : "."$row[9]"."</div>";
echo "<div class='menu'>Semester : "."$row[10]"."</div>";
echo "<div class='menu'>Email : "."$row[13]"."</div>";
echo "<div class='menu'>Mobile Number : "."$row[14]"."</div>";
echo "<div class='menu'>Father's Name : "."$row[15]"."</div>";
echo "<div class='menu'>Mother's Name : "."$row[18]"."</div>";
echo "<div class='menu'>District : "."$row[25]"."</div>";
echo "</div></div></div>";
}
}
else
{
}
?>
<?php
require("footer.php");
?>