-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
executable file
·114 lines (111 loc) · 1.92 KB
/
functions.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
114
<?php
// set all GET/POST vars
if($HTTP_GET_VARS)
{
foreach($HTTP_GET_VARS as $key => $val)
{
$$key = $val;
}
}
// Get all vars from the POST method. Assign variable and value
if($HTTP_POST_VARS)
{
foreach($HTTP_POST_VARS as $key => $val)
{
$$key = $val;
}
}
// get file extension
function GetExt($val) {
//global $image;
$val = strtolower($val);
switch($val) {
case "avi";
$type = "Video File";
$image = "movie.gif";
break;
case "bat";
$type = "Batch File";
$image = "batch.gif";
break;
case "css";
$type = "Cascading Style Sheet";
$image = "text.gif";
break;
case "exe";
$type = "Executable File";
$image = "exe.gif";
break;
case "fla";
$type = "Flash File";
$image = "flash.gif";
break;
case "gif";
$type = "GIF Image";
$image = "image.gif";
break;
case "html";
$type = "HTML File";
$image = "web.gif";
break;
case "htm";
$type = "HTM File";
$image = "web.gif";
break;
case "jpg";
$type = "JPEG Image";
$image = "image.gif";
break;
case "mp3";
$type = "Music File";
$image = "music.gif";
break;
case "msg";
$type = "Email Message";
$image = "email.gif";
break;
case "pdf";
$type = "PDF Acrobat File";
$image = "pdf.gif";
break;
case "psd";
$type = "Photoshop File";
$image = "psd.gif";
break;
case "php";
$type = "PHP File";
$image = "text.gif";
break;
case "ppt";
$type = "PowerPoint Presentation";
$image = "ppt.gif";
break;
case "swf";
$type = "SWF Flash File";
$image = "swf.gif";
break;
case "txt";
$type = "Text Document";
$image = "text.gif";
break;
case "wma";
$type = "Windows Media Audio";
$image = "music.gif";
break;
case "xls";
$type = "Excel File";
$image = "xls.gif";
break;
case "zip";
$type = "Zip File";
$image = "zip.gif";
break;
//--- New Here---//
default:
$type = "Unknown Type";
$image = "unknown.gif";
}
// return both values (to be split)
return $type."?".$image;
}
?>