i want to create a simple picture gallery with wapbuddy script but the problem is that it echos all the other html n php files within that directory all i want it to do is echo only the links of image files.....to be more specific files with .gif,.jpg.jpeg.png and.wbmp extension
it ill be my first php script if you help me out so please help me!!!!!
here is the wapbuddy script
it ill be my first php script if you help me out so please help me!!!!!
here is the wapbuddy script
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<?
extract($_REQUEST);
?>
<? include("../css.php"); ?>
<title>wallapapers section</title><body>
<?php
include("../wapbuddy_settings.php");
if (!isset($_GET['page'])) $page =$_GET['page'];
$total = 0;
if(!($dp = opendir("./"))) die ("Cannot open ./");
$file_array = array();
while ($file = readdir ($dp))
{
if(substr($file,0,1) != '.' and $file != "index.php" and $file != "search.php")
{
$file_array[] = $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
?>
</head>
<body bgcolor="#000000" text="#00FF00" link="#FFFFFF" vlink="#FF0000" alink="#FFFFFF">
<img src='[url]http://c.wen.ru/256908.wbmp?Nahsorhsed'[/url] alt='Создай сайт! Create site!'/>
<big>NAHSORHSEDA</big>
[url="upload.html"]upoad your pics[/url]
<?php include("../menu.php"); ?>
<?
echo "[size="1"]";
echo "[b][u]These downloads Are So Cool![/u][/b]
";
if ($file_count > 0)
{
$first_record = $page * $conf["items_per_page"];
$last_record = $first_record + $conf["items_per_page"];
while (list($fileIndexValue, $file_name) = each ($file_array))
{
if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
{
echo "<a href=\"$file_name\">$file_name</a> (". round(filesize($file_name)/1024,1) . "kb)
------
";
$total = $total + filesize($file_name);
}
}
if (($file_count > 0) AND ($page != 0))
{
// previous button
$prev_page = $page -1;
echo "
<a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">Prev Page</a>
";
}
if (($file_count > 0) AND ($last_record < $file_count))
{
// next button
$next_page = $page + 1;
echo "
<a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">Next Page</a>
";
}
echo "
Total Files:
$file_count ";
if ($file_count == 1)
{echo "file";}
else
{echo "files";}
echo " (" . round($total/1024,1) . "kb)";
}
closedir($dp);
echo "[/size]";
?>
<?
echo '<form action="process.php" method="post">'
.'search file: <input name="q" title="search:" size="5" maxlength="99999999999"/>
'
.'<input type="submit" value="go"/></form>' ?>
[size="1"]page:<? echo"$page"; ?>[/size]
<?
echo '<form action="'.$_SERVER["PHP_SELF"].'" method="get">'
.'Jump to Page: <input name="page" title="Jump to Page:" size="3" maxlength="3"/>
'
.'<input type="submit" value="Jump"/></form>' ?>
[size="1"][url="http://nahsorhseda.wen9.com/Rock2.html"]home[/url][/size]
</p>
</body>
</html>
Comment