du kan vel lave 1fil mere der tager sig af action
ect: act.php
- <?php
- session_start();
- if ($_SESSION["admLogin"]){ //eller andet admin login..
- $action = $_GET["a"];
- $file = $_GET["f"];
- if ($action == "slet"){
- //slet $file
- }
-
- if ($action == "godkend"){
- //godkend $file
- }
-
- if ($action == "download"){
- //download $file
- }
- }
- ?>
index.php:
- <?php
-
- $dir = "../elma/uploads/rec/";
- $godkend = "<a href='logout.php'>|Godkend</a>";
- $slet = "<a href='logout.php'>|Slet</a>";
- $download = "<a href='logout.php'>|Download</a>";
-
- if (is_dir($dir))
- {
- if ($dh = opendir($dir))
- {
- while (($file = readdir($dh)) !== false)
- {
- if ($file != ".." && $file != ".")
- {
- echo "<a href='act.php?a=slet&f=$file'>Slet</a>";
- echo "<a href='act.php?a=godkend&f=$file'>Godkend</a>";
- echo "<a href='act.php?a=download&f=$file'>Download</a>";
- echo $file . "<br />";
- }
- }
- closedir($dh);
- }
- }
-
- ?>
eller noget i den stil
Indlæg senest redigeret d. 09.02.2009 21:11 af Bruger #3427