sharefiles

Gesponsorde koppelingen

PHP script bestanden

  1. sharefiles

« Lees de omschrijving en reacties

index.php

Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?
// SETTINGS
$set_dir = "map"; // Dir waar alle geuploade files instaat, bv map (geen map/ !!!)
?>

<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>ShareFiles</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="includes/style.css" />
<script language="JavaScript" type="text/javascript" src="includes/javascript.js"></script>
</head>
<body>
<h2>ShareFiles</h2>

<?
if(isset($_GET['legenda'])) {
 ?>

 <div align="center">
 <small><a href="index.php">Verberg legenda</a></small><br />
 <table>
  <tr>
   <td><img src="images/excel.gif" alt="Type document" /></td>
   <td>Excel-document <small>(openen met <a href="http://www.microsoft.com/netherlands/office/excel/default.aspx" target="_blank">Microsoft Excel</a>)</small></td>
  </tr>
  <tr>
   <td><img src="images/image.gif" alt="Type document" /></td>
   <td>Afbeelding <small>(gif,bmp of jpg)</small></td>
  </tr>
  <tr>
   <td><img src="images/map.gif" alt="Type document" /></td>
   <td>Map</td>
  </tr>
  <tr>
   <td><img src="images/overhoor.gif" alt="Type document" /></td>
   <td>Overhoor-tabel <small>(openen met <a href="http://home.wanadoo.nl/overhoor/overhoor/overhoor.html" target="_blank">Overhoor</a>)</small></td>
  </tr>
  <tr>
   <td><img src="images/text.gif" alt="Type document" /></td>
   <td>Tekstdocument <small>(openen met Kladblok)</small></td>
  </tr>
  <tr>
   <td><img src="images/word.gif" alt="Type document" /></td>
   <td>Word document <small>(openen met <a href="http://www.microsoft.com/netherlands/office/word/default.aspx" target="_blank">Microsoft Word</a>)</small></td>
  </tr>
  <tr>
   <td><img src="images/zip.gif" alt="Type document" /></td>
   <td>ZIP bestand <small>(openen met <a href="http://www.winzip.com/" target="_blank">WinZip</a>)</small></td>
  </tr>
  <tr>
   <td><img src="images/unknown.gif" alt="Type document" /></td>
   <td>Onbekend bestand of een bestand waarvoor geen icoon is</td>
  </tr>
 </table>
 </div>
 <p />
 <?
}
?>

<div align="center">
<table class="tbl1" cellspacing="0">
 <tr>
  <td class="td1">&nbsp;</td>
  <td class="td2">&nbsp;<b>ShareFiles</b></td>
  <td class="td3">&nbsp;</td>
 </tr>
 <tr>
  <td width="16"></td>
  <td width="134" style="border-right: 2px solid #66667E;" valign="top">
   <table>
    <tr>
     <td><img src="images/map.gif" alt="Map" /></td>
     <td><a href="index.php?dir=">/</a></td>
    </tr>
    <?
    if ($handle = opendir($set_dir."/")) {
     while (false !== ($dir = readdir($handle))) {
      $extentie = substr($dir, -4, -3);
      if(($dir != ".") AND ($dir != "..") AND ($extentie != ".")){
       echo "<tr>\n";
       echo "<td><img src=\"images/map.gif\" alt=\"Map\" /></td>\n";
       echo "<td><a href=\"index.php?dir=".$dir."\">".$dir."</a></td>\n";
       echo "</tr>\n";
      }
     }
    }

    ?>

   </table>
  </td>
  <td width="550" valign="top">
  
   <?
   if(isset($_GET['dir'])) {
    if(file_exists($set_dir."/".$_GET['dir'])) {
     $dir = "/".$_GET['dir'];
    }
else{
     $dir = "/";
    }
   }
else{
    $dir = "/";
   }

   ?>

   <table>
    <?
    $i
= 0;
    if ($handle = opendir($set_dir.$dir)) {
     while (false !== ($file = readdir($handle))) {
      $extentie = substr($file, -4, -3);
      $extentie2 = substr($file, -3);
      if(($file != ".") AND ($file != "..") AND ($extentie == ".")){
       $i++;
       if($dir == "/") {
        $urlfile = $set_dir."/";
       }
else{
        $urlfile = $set_dir."/".$_GET['dir']."/";
       }

       if(($extentie2 == "JPG") OR ($extentie2 == "jpg") OR ($extentie2 == "GIF") OR ($extentie2 == "gif") OR ($extentie2 == "BMP") OR ($extentie2 == "bmp")) {
        $icon = "images/image.gif";
       }
elseif(($extentie2 == "OH4") OR ($extentie2 == "oh4")) {
        $icon = "images/overhoor.gif";
       }
elseif(($extentie2 == "XLS") OR ($extentie2 == "xls")) {
        $icon = "images/excel.gif";
       }
elseif(($extentie2 == "DOC") OR ($extentie2 == "doc")) {
        $icon = "images/word.gif";
       }
elseif(($extentie2 == "TXT") OR ($extentie2 == "txt")) {
        $icon = "images/text.gif";
       }
elseif(($extentie2 == "ZIP") OR ($extentie2 == "zip")) {
        $icon = "images/zip.gif";
       }
else{
        $icon = "images/unknown.gif";
       }

       echo "<tr>\n";
       echo "<td><img src=\"".$icon."\" width=\"16\" height=\"16\" alt=\"Type bestand\" /></td>\n";
       echo "<td><a href=\"".$urlfile.$file."\" target=\"_blank\">".$file."</a></td>\n";
       echo "</tr>\n";
      }
     }
    }

    if($i == 0) {
     if($_GET['dir'] == "") {
      $dir = "/";
     }
else{
      $dir = $_GET['dir'];
     }

     echo "<tr>\n";
     echo "<td></td>\n";
     echo "<td>Geen bestanden in map <b>".$dir."</b></td>\n";
     echo "</tr>\n";
    }

    ?>

   </table>  
  </td>
 </tr>
</table>
</div>

<p align="center">
<a href="index.php?legenda" title="Legenda tonen">Legenda</a> | <a href="admin.php" title="Beheer">Beheer</a><br />
<a href="http://validator.w3.org/check?uri=referer" target="_blank"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a>
</p>
</body>
</html>


admin.php
Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
<?
session_start();

// Functie om mappen met inhoud te verwijderen
function deldir($dir) {
 $dh=opendir($dir);
 while ($file=readdir($dh)) {
  if($file!="." && $file!="..") {
   $fullpath=$dir."/".$file;
   if(!is_dir($fullpath)) {
    unlink($fullpath);
   }
else{
    deldir($fullpath);
   }
  }
 }

 closedir($dh);
  
 if(rmdir($dir)) {
  return true;
 }
else{
  return false;
 }
}

?>

<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Admin ShareFiles</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="includes/style.css" />
<script language="JavaScript" type="text/javascript" src="includes/javascript.js"></script>
</head>
<body>
<?
// INLOGSETTINGS
$user = "test";
$pass = "test";

// SETTINGS
$set_dir = "map"; // Map waar alles naar geupload moet worden, bv map (geen map/ !)

// Kijken of je ingelogd bent

if($_SESSION['school_naam'] == $user AND $_SESSION['school_pass'] == $pass) {

// UITLOGGEN
if(isset($_GET['uitloggen'])) {
 session_destroy();
 session_unset();
 echo "Je bent nu uitgelogd.<br />\n";
 echo "&nbsp;&nbsp;<a href=\"admin.php\"><img src=\"images/terug.gif\" border=\"0\" alt=\"Terug\" /> Terug</a>";
// UPLOADEN
}elseif($_POST['MAX_FILE_SIZE'] != "") {
 global $_FILES;

 $filename = $_FILES['userfile']['name'];

 // Toegestane bestanden, deze kun je zelf aanpassen, verwijderen, of toevoegen..
 $allow[0] = "jpg";
 $allow[1] = "gif";
 $allow[2] = "bmp";
 $allow[3] = "oh4";
 $allow[4] = "xls";
 $allow[5] = "doc";
 $allow[6] = "txt";
 $allow[7] = "JPG";
 $allow[8] = "GIF";
 $allow[9] = "BMP";
 $allow[10] = "OH4";
 $allow[11] = "XLS";
 $allow[12] = "DOC";
 $allow[13] = "TXT";
 $allow[14] = "zip";
 $allow[15] = "ZIP";
 
 $extentie = substr($_FILES['userfile']['name'], -3);
 
 for ($i = 0; $i < count($allow); $i++){
  if ($extentie == $allow[$i]) {
   $extentie_check = "ok";
   $i = count($allow) + 5;
  }
 }

 
 if ($extentie_check){
  if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {  
   move_uploaded_file($_FILES['userfile']['tmp_name'], $set_dir."/".$_POST['map'].$_FILES['userfile']['name']);  
   echo "Het bestand is succesvol geupload.<br />\n";
   echo "&nbsp;&nbsp;<a href=\"admin.php\"><img src=\"images/terug.gif\" border=\"0\" alt=\"Terug\" /> Terug</a>";
  }
else{
   echo "Het bestand dat jij koos kon niet worden geupload. Het bestand is groter dan 900 kb<br />\n";
   echo "&nbsp;&nbsp;<a href=\"admin.php\"><img src=\"images/terug.gif\" border=\"0\" alt=\"Terug\" /> Terug</a>";
  }
 }
else{
  echo "Het bestand dat jij koos kon niet worden geupload. Het bestand heeft een verkeerde extensie.<br />\n";
  echo "&nbsp;&nbsp;<a href=\"admin.php\"><img src=\"images/terug.gif\" border=\"0\" alt=\"Terug\" /> Terug</a>";
 }

// HERNOEMEN
}elseif(isset($_GET['edit'])){
 if(isset($_GET['file_dir'])) {
  $filedir = $set_dir."/".$_GET['file_dir']."/";
 }
else{
  $filedir = $set_dir."/";
 }

 if(file_exists($filedir.$_GET['edit'])){
  if(isset($_POST['submit'])) {
   $extentie = substr($_POST['nieuw_naam'], -4, -3);
   if($extentie == ".") {
    $rename = @rename($filedir.$_GET['edit'], $filedir.$_POST['nieuw_naam']);
   }
else{
    $extentie = substr($_GET['edit'], -3);
    $rename = @rename($filedir.$_GET['edit'], $filedir.$_POST['nieuw_naam'].".".$extentie);
   }

   if($rename == TRUE) {
    echo "Het bestand <b>".$_GET['edit']."</b> is succesvol hernoemd.<br />\n";
   }
else{
    echo "Hernoemen is mislukt. Een bestand met deze naam bestaat mogelijk al.<br />\n";
   }

   echo "&nbsp;&nbsp;<a href=\"admin.php\"><img src=\"images/terug.gif\" border=\"0\" alt=\"Terug\" /> Terug</a>";
  }
else{
  ?>

  <h2>Naam wijzigen</h2>
  <form method="post" action="admin.php?edit=<? echo $_GET['edit']; ?>&file_dir=<? echo $_GET['file_dir']; ?>">
  <table>
   <tr>
    <td>Bestand:</td><td><b><? echo $_GET['edit']; ?></b>
    <?
    if(isset($_GET['file_dir'])) {
     echo "<small>(in map <b>".$_GET['file_dir']."</b>)</small>";
    }

    ?>

    </td>
   </tr>
   <tr>
    <td>Nieuwe naam:</td><td><input type="text" name="nieuw_naam" maxlength="30" /></td>
   </tr>
   <tr>
    <td></td><td><input type="submit" name="submit" value="Wijzigen" /></td>
   </tr>
  </table>
  </form>
  <?
  }
 }
else{
  echo "Het bestand <b>".$_GET['edit']."</b> bestaat niet.<br>\n";
  echo "&nbsp;&nbsp;<a href=\"admin.php\"><img src=\"images/terug.gif\" border=\"0\" alt=\"Terug\" /> Terug</a>";
 }

// VERPLAATSEN
}elseif(isset($_POST['movesubmit'])) {
 if($_GET['oudmap'] != "") {
  $ouddir = $set_dir."/".$_GET['oudmap']."/".$_POST['bestand'];
  
 }
else{
  $ouddir = $set_dir."/".$_POST['bestand'];
 }

 if($_POST['nieuwmap'] != "") {
  $nieuwdir = $set_dir."/".$_POST['nieuwmap']."/".$_POST['bestand'];
 }
else{
  $nieuwdir = $set_dir."/".$_POST['bestand'];
 }

 $copy = @copy($ouddir, $nieuwdir);
 $del = @unlink($ouddir);
 if($copy == TRUE AND $del == TRUE) {
  echo "Het bestand <b>".$_POST['bestand']."</b> is succesvol verplaatst.<br />\n";
 }
else{
  echo "Het bestand <b>".$_POST['bestand']."</b> kon niet worden verplaatst.<br />\n";
 }

 echo "&nbsp;&nbsp;<a href=\"admin.php\"><img src=\"images/terug.gif\" border=\"0\" alt=\"Terug\" /> Terug</a>";
// VERWIJDEREN
}elseif(isset($_GET['delete'])) {
 if(file_exists($set_dir."/".$_GET['delete'])){
  unlink($set_dir."/".$_GET['delete']);
  echo "Het bestand <b>".$_GET['delete']."</b> is succesvol verwijderd.<br />\n";
  echo "&nbsp;&nbsp;<a href=\"admin.php\"><img src=\"images/terug.gif\" border=\"0\" alt=\"Terug\" /> Terug</a>";
 }
else{
  echo "Het bestand <b>".$_GET['delete']."</b> bestaat niet.<br />\n";
  echo "&nbsp;&nbsp;<a href=\"admin.php\"><img src=\"images/terug.gif\" border=\"0\" alt=\"Terug\" /> Terug</a>";
 }

// MAP MAKEN
}elseif($_POST['mkdir_submit']){
 mkdir($set_dir."/".$_POST['map'], 0777);
 echo "De map <b>".$_POST['map']."</b> is aangemaakt.<br />\n";
 echo "&nbsp;&nbsp;<a href=\"admin.php\"><img src=\"images/terug.gif\" border=\"0\" alt=\"Terug\" /> Terug</a>";
// MAP VERWIJDEREN
}elseif($_GET['rmdir'] != "" AND $_GET['rmdir'] != "/" AND $_GET['rmdir'] != "\\"){
 if(file_exists($set_dir."/".$_GET['rmdir'])) {
  $deldir = @deldir($set_dir."/".$_GET['rmdir']);
  if($deldir == true) {
   echo "De map <b>" . $_GET['rmdir'] . "</b> is succesvol verwijderd.<br />\n";
  }
else{
   echo "De map <b>" . $_GET['rmdir'] . "</b> is niet verwijderd.<br />\n";
  }
 }
else{
  echo "De map <b>" . $_GET['rmdir'] . "</b> bestaat niet.<br />\n";
 }

 echo "&nbsp;&nbsp;<a href=\"admin.php\"><img src=\"images/terug.gif\" border=\"0\" alt=\"Terug\" /> Terug</a>";
}
else{
 ?>

 <h2>ShareFiles Admin<br /></h2>
 <hr width="10%" align="left" />    
 <!-- uploaden -->
 <form enctype="multipart/form-data" action="admin.php" method="post">
 <input type="hidden" name="MAX_FILE_SIZE" value="921600" />
 <table>
  <tr>
   <td width="75">Bestand:</td><td><input name="userfile" type="file" size="20" /></td>
  </tr>
  <tr>
   <td>In map:</td><td>
   <select name="map">
   <option value="">/</option>
   <?
   if ($handle = opendir($set_dir)) {
    while (false !== ($dir = readdir($handle))) {
     $extentie = substr($dir, -4, -3);
     if(($dir != ".") AND ($dir != "..") AND ($extentie != ".")){
      echo "<option value=\"".$dir."/\">".$dir."</option>\n";
     }
    }
   }

   ?>

   </select>
   </td>
  </tr>
  <tr>
   <td></td><td><input type="submit" value="Uploaden" /></td>
  </tr>
 </table>
 </form>
 <hr width="10%" align="left" />
 <!-- map maken -->
 <form action="admin.php" method="post">
 <table>
  <tr>
   <td width="75">Map:</td><td><input type="text" name="map" maxlength="30" size="20" /></td>
  </tr>
  <tr>
   <td></td><td><input type="submit" name="mkdir_submit" value="Aanmaken" /></td>
  </tr>
 </table>
 </form>
 <hr width="10%" align="left" />
 <!-- verplaatsen -->
 <form action="admin.php" method="get">
 <table>
  <tr>
   <td width="75">Map:</td><td>
   <select name="oudmap" onchange='this.form.submit()'>
   <option value="">/</option>
   <?
   if ($handle = opendir($set_dir)) {
    while (false !== ($dir = readdir($handle))) {
     $extentie = substr($dir, -4, -3);
     if(($dir != ".") AND ($dir != "..") AND ($extentie != ".")){
      if($_GET['oudmap'] == $dir) {
       echo "<option value=\"".$dir."\" selected=\"selected\">".$dir."</option>\n";
      }
else{
       echo "<option value=\"".$dir."\">".$dir."</option>\n";
      }
     }
    }
   }

   ?>

   </select></td>
  </tr>
 </table>
 </form>
 <form method="post" action="admin.php?oudmap=<? echo $_GET['oudmap']; ?>">
 <table>
  <tr>
   <td width="75">Bestand:</td><td>
   <select name="bestand">
   <?
   if($_GET['oudmap'] != "") {
    $filedir = $_GET['oudmap']."/";
   }
else{
    $filedir = "";
   }

   $i = 0;
   if ($handle = opendir($set_dir."/".$filedir)) {
    while (false !== ($file = readdir($handle))) {
     $extentie = substr($file, -4, -3);
     if(($dir != ".") AND ($dir != "..") AND ($extentie == ".")){
     $i++;
      echo "<option value=\"".$file."\">".$file."</option>\n";
     }
    }
   }

   if($i == 0) {
    echo "<option value=\"\"></option>\n";
   }

   ?>

   </select>
   <?
   ?>
</td>
  </tr>
  <tr>
   <td>Verplaatsen naar:</td><td>
   <select name="nieuwmap">
   <option value="">/</option>
   <?
   if ($handle = opendir($set_dir)) {
    while (false !== ($dir = readdir($handle))) {
     $extentie = substr($dir, -4, -3);
     if(($dir != ".") AND ($dir != "..") AND ($extentie != ".")){
      echo "<option value=\"".$dir."/\">".$dir."</option>\n";
     }
    }
   }

   ?>

   </select></td>
  </tr>
  <tr>
   <td></td><td><input type="submit" name="movesubmit" value="Verplaatsen" /></td>
  </tr>
 </table>
 </form>
 <p />
 <!-- mappenlijst -->
 <table cellspacing="0">
  <tr>
   <td width="19" bgcolor="#e4e4e4"></td><td width="19" bgcolor="#e4e4e4"></td><td bgcolor="#e4e4e4" width="175"><b>Mappen</b></td>
  </tr>
  <tr>
   <td></td><td></td>
   <td><a href="admin.php?dir=">/</a></td>
  </tr>
  <?
  if ($handle = opendir($set_dir)) {
   while (false !== ($dir = readdir($handle))) {
    $extentie = substr($dir, -4, -3);
    if(($dir != ".") AND ($dir != "..") AND ($extentie != ".")){
     echo "<tr>\n";
     echo "<td><a href=\"admin.php?rmdir=".$dir."\" onclick=\"return confirmLink(this, '".$dir." (map) verwijderen')\"><img src=\"images/delete.png\" border=\"0\" alt=\"Verwijderen\" /></a></td>\n";
     echo "<td></td>\n";
     echo "<td><a href=\"admin.php?dir=".$dir."\">".$dir."</a></td>\n";
     echo "</tr>\n";
    }
   }
  }

  ?>

 </table>
 <p />
 <!-- bestandenlijst -->
 <?
 if(isset($_GET['dir'])) {
   if(file_exists($set_dir."/".$_GET['dir'])) {
    $dir = "/".$_GET['dir'];
   }
else{
    $dir = "/";
   }
  }
else{
   $dir = "/";
  }

 ?>

 <table cellspacing="0">
  <tr>
   <td width="19" bgcolor="#e4e4e4"></td><td width="19" bgcolor="#e4e4e4"></td><td bgcolor="#e4e4e4" width="175"><b>Bestanden in <? echo $dir; ?></b></td>
  </tr>
  <?
  if ($handle = opendir($set_dir.$dir)) {
   while (false !== ($file = readdir($handle))) {
    $extentie = substr($file, -4, -3);
    if(($file != ".") AND ($file != "..") AND ($extentie == ".")){
     if($dir == "/") {
      $editfile = $file;
      $delfile = $file;
      $urlfile = $set_dir."/";
     }
else{
      $editfile = $file."&file_dir=".$_GET['dir'];
      $delfile = $_GET['dir']."/".$file;
      $urlfile = $set_dir."/".$_GET['dir']."/";
     }

     echo "<tr>\n";
     echo "<td><a href=\"admin.php?delete=".$delfile."\" onclick=\"return confirmLink(this, '".$delfile." verwijderen')\"><img src=\"images/delete.png\" border=\"0\" alt=\"Verwijderen\" /></a></td>\n";
     echo "<td><a href=\"admin.php?edit=".$editfile."\"><img src=\"images/edit.png\" border=\"0\" alt=\"Bewerken\" /></a></td>\n";
     echo "<td><a href=\"".$urlfile.$file."\" target=\"_blank\">".$file."</a></td>\n";
     echo "</tr>\n";
    }
   }
  }

  ?>

 </table>

<?
}

}
else{
echo "<h2>ShareFiles Admin<br />Inloggen</h2>";
if(isset($_POST['submit'])) {
 if($_POST['naam'] == $user AND $_POST['wachtwoord'] == $pass) {
  $_SESSION['school_naam'] = $user;
  $_SESSION['school_pass'] = $pass;
  header("Location: admin.php");
 }
else{
  echo "Je wachtwoord en/of gebruikersnaam is incorrect";
 }
}

?>

<form method="post" action="admin.php">
<table>
 <tr>
  <td>Naam:</td><td><input type="text" name="naam" value="test" /></td>
 </tr>
 <tr>
  <td>Wachtwoord:</td><td><input type="password" name="wachtwoord" value="test" /></td>
 </tr>
 <tr>
  <td></td><td><input type="submit" name="submit" value="Inloggen" /></td>
 </tr>
</table>
</form>
<?
}
?>

<p align="center">
<?
if($_SESSION['school_naam'] == $user AND $_SESSION['school_pass'] == $pass) {
 echo "<a href=\"admin.php?uitloggen\">Uitloggen</a><br />\n";
}

?>

<a href="http://validator.w3.org/check?uri=referer" target="_blank"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a>
</p>
</body>
</html>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.