-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
87 lines (74 loc) · 1.92 KB
/
index.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
<?php
require_once 'Login.php';
require_once 'Upload.php';
$login= new Login();
$login->validateLogin(@$_POST['user'], @$_POST['pass']);
$login->logout(@$_GET['logout']);
$u=new Upload($login);
$u->uploaddir('img');
if ($login->loggedIn())
$u->upload();
if (isset($_GET['delete'])){
echo "<h1>delete</h1>";
$u->delete(@$_GET['delete']);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" media="all" href="layout.css">
<script type="text/javascript" src="libs/zeroclipboard/ZeroClipboard.js"></script>
<script>ZeroClipboard.setMoviePath( 'libs/zeroclipboard/ZeroClipboard10.swf' );</script>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<title>File Upload</title>
</head>
<body>
<header></header>
<nav></nav>
<section id="main">
<?php
if ($login->loggedIn()){
echo '
<form id="upload" action="index.php" enctype="multipart/form-data" method="post">
<fieldset>
<legend>upload images <a href="index.php?logout=true">logout</a></legend>
<ol>
<li><label for="local">from pc</label> <input
id="local" type="file" name="file">
</li>
<li><label for="remote">from url</label> <input id="remote"
type="text" size="37" name="link">
</li>
</ol>
</fieldset>
<fieldset>
<button type="submit" name="submit">upload</button>
</fieldset>
</form>
';
} else {
echo '
<form id="login" action="index.php" method="post">
<fieldset>
<legend>login</legend>
<ol>
<li><label for="user">user</label>
<input id="user" type="text" name="user" size="20">
</li>
<li><label for="pass">pass</label>
<input id="pass" type="password" size="20" name="pass">
</li>
</ol>
</fieldset>
<fieldset>
<button type="submit" name="submit">login</button>
</fieldset>
</form>';
}
?>
<?php $u->showlastImage();
$u->showImages(); ?>
</section>
</body>
</html>