I am trying to made a script that will show all the files in a Directory…..
Also I want to add the option to delete the files from the directory.
I can view the files on the directory the problem is when I add this line that add the option to delete the files in the directory
LINE--->27 echo "<a href="browserdir2.php/?k='.$link.'&ko=1">'.$file.'</a><br>";
The error message that I get is :
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in c:\diphp\webroot\browserdir2.php on line 27
Please help me !!!
Thank you.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<?php
$s = 0;
$s = $_POST["ko"];
$filename =$_POST["k"];
if ($s == 1) {
unlink($filename);
}
?>
<body>
<?php
$current_dir = "C:\diphp\webroot\fileup";
$dir = opendir($current_dir);
echo "Upload directory is $current_dir<br>";
echo "Directory Listing :<br><hr><br>";
while ($file = readdir($dir))
{
LINE--->27 echo "<a href="browserdir2.php/?k='.$link.'&ko=1">'.$file.'</a><br>";
}
echo "<ht><br>";
closedir($dir);
?>
</body>
</html>