-
Notifications
You must be signed in to change notification settings - Fork 72
/
showimage.php
53 lines (49 loc) · 1.41 KB
/
showimage.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
<?php require_once("includes/session.php"); ?>
<?php require_once("includes/connection.php"); ?>
<?php
$main = $_GET['main'];
$sub = $_GET['sub'];
if($sub == 0)
{
$query = mysql_query("select * from vstudent where current_id = '$main'") or die(mysql_error());
$qr = mysql_fetch_array($query);
$imageData = $qr['pic'];
}
else if($sub == 1)
{
$id_query = mysql_query("select id from current_id where sno = '$main'");
$id = mysql_fetch_array($id_query);
$query = mysql_query("select * from parent where id = '$id[id]'") or die(mysql_error());
$qr = mysql_fetch_array($query);
$imageData = $qr['fpic'];
}
else if($sub == 2)
{
$id_query = mysql_query("select id from current_id where sno = '$main'");
$id = mysql_fetch_array($id_query);
$query = mysql_query("select * from parent where id = '$id[id]'") or die(mysql_error());
$qr = mysql_fetch_array($query);
$imageData = $qr['mpic'];
}
else
{
$query = mysql_query("select * from admin where sno = '1'") or die(mysql_error());
while($qr = mysql_fetch_array($query))
{
//die(mysql_error());
$imageData = $qr[1];
}
}
if(empty($imageData))
{
$query = mysql_query("select * from admin where sno = '1'") or die(mysql_error());
while($qr = mysql_fetch_array($query))
{
//die(mysql_error());
$imageData = $qr[1];
}
}
header("content-type: image/jpeg");
echo $imageData;
//else echo "No Image";
?>