<!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;
}
function SnimiPromenljivu($prom)
{
$handle=fopen("mainbanner.dat","wb");
$text="mainbanner=".$prom."\n";
if (fwrite($handle, $text)==FALSE) {
echo "Cant write in podaci.dat";
}
fclose($handle);
}
echo "<br /><br />";
$lista=dirList("./banners");
$test=false;
for ($i=0; $i<count($lista); $i++)
{
$imeoveslike=$lista[$i];
if ($imeoveslike==$_REQUEST["fajl2"])
{ $test=true; }
}
if ($test)
{
echo "You have selected this banner: <br /><br />";
echo "<img src='banners/".$_REQUEST['fajl2']."'>";
echo "<br /><br />";
SnimiPromenljivu($_REQUEST['fajl2']);
echo "Click <a href='chbanner.php'> here </a> to continue";
}
else
{ echo "There is no banner with that caption! <br />";
echo "Click <a href='chbanner.php'> here </a> to try again ";
}
?></div>
</div>
<div id="footer">
<p></p>
</div>
</div>
</body>
</html>