Kod
Warning: unlink() [function.unlink]: No error in C:\Program Files (x86)\WebServ\httpd\hairsalon\admino.php on line 24
I nie wiem jak to naprawić.
Mój kod akcji:
Kod
<?php
if(isset($_GET['delete']))
{
$delete_file = $_GET[$file];
unlink("$delete_file");
} ?>
if(isset($_GET['delete']))
{
$delete_file = $_GET[$file];
unlink("$delete_file");
} ?>
A tu skrypt na liste wszystkich plików:
Kod
<?
// Define the full path to your folder from root
$path = "obrazki/";
// Open the folder
$dir_handle = @opendir($path) or die("Unable to open $path");
// Loop through the files
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file == "index.php" )
continue;
echo "<a href=\"admino.php?delete=$file\"><font color=\"red\"> X</font></a> <a href=\"obrazki/$file\" rel=\"lightbox\" target=\"_blank\">$file</a><br /> ";
}
// Close
closedir($dir_handle);
?>
// Define the full path to your folder from root
$path = "obrazki/";
// Open the folder
$dir_handle = @opendir($path) or die("Unable to open $path");
// Loop through the files
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file == "index.php" )
continue;
echo "<a href=\"admino.php?delete=$file\"><font color=\"red\"> X</font></a> <a href=\"obrazki/$file\" rel=\"lightbox\" target=\"_blank\">$file</a><br /> ";
}
// Close
closedir($dir_handle);
?>
Jak widać, tam gdzie jest echo, dodałem hyperlinka admino.php?delete=$file i po tym nazwa pliku
Proszę o pomoc
Pozdrawiam