Location: PHPKode > scripts > Banner Rotator with admin panel > banner-rotator-with-admin-panel/chbanner4.php
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 7 December 2008), see www.w3.org">
<title>Banner rotator Control Panel</title>
<link rel="stylesheet" href="stylecp.css" type="text/css" media=
"screen">
</head>
<body>
	<!-- http://TheAleksandar.com -->

<div id="page">
<div id="header"></div>
<div id="menulinks"><a href="chpass.php">Change password</a>
<a href="chbanner.php">Banner images</a> <a href="chadsense.php">Banner link URLs</a> <a href=
"banneroveral.php">Main page</a></div>

<div id="mainarea">
<div id="contentarea"><?php
function dirList ($directory) 
{

    // create an array to hold directory list
    $results = array();

    // create a handler for the directory
    $handler = opendir($directory);

    // keep going until all files in directory have been read
    while ($file = readdir($handler)) {

        // if $file isn't this directory or its parent, 
        // add it to the results array
        if ($file != '.' && $file != '..')
            $results[] = $file;
    }

    // tidy up: close the handler
    closedir($handler);

    // done!
    return $results;

}

echo "<br /><br />";


$lista=dirList("./banners");


$test=false;

for ($i=0; $i<count($lista); $i++)
{
$imeoveslike=$lista[$i];
if ($imeoveslike==$_REQUEST["fajl3"])
        { $test=true; }
}

if ($test)
{ 

$imefajla="banners/".$_REQUEST["fajl3"];

unlink($imefajla);

echo "Banner ".$_REQUEST['fajl3']." has been deleted <br /><br />";

echo "Click <a href='chbanner.php'> here </a> to continue";

}
else
{ echo "There is no banner with that name! <br />";
echo "Click <a href='chbanner.php'> here </a> to try again ";
}




?></div>
</div>
<div id="footer">
<p></p>
</div>
</div>
</body>
</html>
Return current item: Banner Rotator with admin panel