-
Notifications
You must be signed in to change notification settings - Fork 45
/
image.php
41 lines (34 loc) · 1.04 KB
/
image.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
<?php
$url = "";
//get the image url
if (isset( $_GET['i'] ) ) {
$url = $_GET[ 'i' ];
} else {
exit();
}
//we can only do jpg and png here
if (strpos($url, ".jpg") && strpos($url, ".jpeg") && strpos($url, ".png") != true ) {
echo strpos($url, ".jpg");
echo "Unsupported file type :(";
exit();
}
//image needs to start with http
if (substr( $url, 0, 4 ) != "http") {
echo("Image failed :(");
exit();
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 2.0//EN">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<html>
<head>
<title>FrogFind Image Viewer</title>
</head>
<body">
<small><a href="<?php echo $_SERVER['HTTP_REFERER'] ?>">< Back to previous page</a></small>
<p><small><b>Viewing image:</b> <?php echo $url ?></small></p>
<img src="/image_compressed.php?i=<?php echo $url; ?>">
<br><br>
<small><a href="<?php echo $_SERVER['HTTP_REFERER'] ?>">< Back to previous page</a></small>
</body>
</html>