Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/mm/bmb/
Upload File :
Current File : /var/www/html/mmishra/mm/bmb/gallery.php

<?php
//checklogin($user);
$fname = $_REQUEST["fname"];
$no = $_REQUEST["no"];
if (!$no) $no = 1;
$i = 0;

$agPath = absolutePath($webid,'gallery');
$rgPath = relativePath($webid,'gallery');

if ($fname) shell_exec("rm -f {$agPath}/{$fname}");

$dh  = opendir($agPath);
while (false !== ($filename = readdir($dh))) {
        if (strlen($filename) > 2) {
                $files[] = $filename;
                $i++;
        }
}
if ($no > $i) $no = 1;

$fname = $files[$no];
if (!$fname) $fname = $files[0];
echo "$fname ($no of $i photos)<center>
<img src='$rgPath/$fname' width='400' height='400'></img><br>";
$no--;
if ($no > 0) echo "[ <a href='$PHP_SELF?conf=$conf&no=$no'>Prev</a> ]";
$no++; $no++;
if ($no <= $i) echo "[ <a href='$PHP_SELF?conf=$conf&no=$no'>Next</a> ]";
echo "</center>";
if ($user) {
	echo "<div align='right'>";
	$rs1 = mysql_query("select * from $tbl where pagecontent like 'upload%'");
	if ($rs1) {
		$q = mysql_fetch_object($rs1);
		echo "[ <a href='$PHP_SELF?conf={$q->rowid}&addto_gallery=yes'>Add</a> ]";
	}
	echo "[ <a href='$PHP_SELF?conf=$conf&action=remove&no=$no&fname=$fname'>Remove</a> ]
	</div>";
}

?>