-
Notifications
You must be signed in to change notification settings - Fork 0
/
up.php
54 lines (44 loc) · 1.13 KB
/
up.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
<?php
/**
* @file up.php
* @author jc <[email protected]>
* @date Thu Mar 10 18:34:59 2011
*
* @brief
*
*
*/
include_once 'config/config.php';
include_once 'utils/common.php';
include_once 'classes/Db.class.php';
include_once 'classes/Renderer.class.php';
$content = '';
if (!(isset($_GET['u'])) || $_GET['u'] == '') {
$content .= "OOpssss";
}
else {
$u = htmlentities($_GET['u']);
$db = Db::getInstance();
if (!$db->connect($conf['sql']['host'], $conf['sql']['user'], $conf['sql']['password'], $conf['sql']['db'])) {
echo 'can\'t connect to db';
return;
}
if (!(check_form($u))) {
$content .= "OOpssss Can't find that form";
$db->close();
}
else {
$db->close();
$content .= '
<form method="post" action="post.php" enctype="multipart/form-data">
<input type="hidden" name="u" id="u" value="' . $u . '" />
<input type="file" name="file" id="file" /><br />
<input type="submit" value="Uploader" />
</form>
';
}
}
$renderer = new Renderer();
$renderer->setContent($content);
$renderer->render();
?>