Please help me file name and folder name when upload by by browser Folder and file name it does not array .. A B C-Z or 1-9 ..please help me to fix this problem... Really thanks
the cause is when i moved to new hosting it happen like this problem
Pleaseeeee... fix this problem to help.. i don;t know how to fix it ( coz this is a open source and i don't know about php that much )
<?
require_once ("../include/errorhandling.php");
require_once ("../include/config.php");
$GLOBALS["rootdp"] = '../';
include ("../include/access.php");
include ("../include/functions.php");
include ("../include/settings.php");
include ("../".$GLOBALS["language_home"].$GLOBALS["gsLanguage"]."/lang_admin.php");
include ("../".$GLOBALS["language_home"].$GLOBALS["gsLanguage"]."/lang_images.php");
if (!isset($HTTP_GET_VARS["subdir"]))
{
$subdir = '';
}
else
{
$subdir = $HTTP_GET_VARS["subdir"];
}
$ImageFileTypes[] = "gif";
$ImageFileTypes[] = "jpg";
$ImageFileTypes[] = "png";
force_page_refresh();
frmImages();
function frmImages()
{
global $ImageFileTypes, $subdir;
global $HTTP_GET_VARS;
?>
<html>
<head>
<LINK HREF="<? echo $GLOBALS["rootdp"].$GLOBALS["style_home"]; ?>vs.css" REL=STYLESHEET TYPE="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
</head>
<body leftmargin=0 topmargin=0 marginwidth="0" marginheight="0" bgcolor="#000000">
<table border="0" width="100%" cellspacing="3" cellpadding="3">
<tr bgcolor="#505050">
<td colspan="4" align="center">
<b><? echo $GLOBALS["tFormTitle"]; ?></b>
</td>
</tr><?
// Generate image tags for the different images that appear on the page
$GLOBALS["iFirst"] = lsimagehtmltag($GLOBALS["icon_home"],'first1.gif',$GLOBALS["gsLanguage"],$GLOBALS["tFirstPage"],0);
$GLOBALS["iPrev"] = lsimagehtmltag($GLOBALS["icon_home"],'last1.gif',$GLOBALS["gsLanguage"],$GLOBALS["tPrevPage"],0);
$GLOBALS["iNext"] = lsimagehtmltag($GLOBALS["icon_home"],'next1.gif',$GLOBALS["gsLanguage"],$GLOBALS["tNextPage"],0);
$GLOBALS["iLast"] = lsimagehtmltag($GLOBALS["icon_home"],'end1.gif',$GLOBALS["gsLanguage"],$GLOBALS["tLastPage"],0);
$GLOBALS["iAddNew"] = lsimagehtmltag($GLOBALS["icon_home"],'addnew.gif',$GLOBALS["gsLanguage"],$GLOBALS["tAddNewMenu"],0);
$iDelete = lsimagehtmltag($GLOBALS["icon_home"],'del_e-wrs.gif',$GLOBALS["gsLanguage"],$GLOBALS["tDeleteMenu"],0);
$iOpenFolder = lsimagehtmltag($GLOBALS["icon_home"],'floderphotos2.gif','',0,'');
$iBlank = lsimagehtmltag($GLOBALS["icon_home"],'blank.gif','',0,'');
if($HTTP_GET_VARS["page"] != "")
{
$nCurrentPage = $HTTP_GET_VARS["page"];
}
else
{
$nCurrentPage = 0;
}
$lRecCount = lCountImages();
$nPages = intval(($lRecCount - 0.5) / $GLOBALS["RECORDS_PER_PAGE"]) + 1;
$lStartRec = $nCurrentPage * $GLOBALS["RECORDS_PER_PAGE"];
frmImagesHdFt(4,$nCurrentPage,$nPages);
?>
$array = $GLOBALS[$tImageName];
<tr bgcolor="#99CC00">
<td colspan="4" align="left"><? echo $GLOBALS["image_home"].$subdir ?></td>
</tr>
<tr bgcolor="#FFCC00">
<td width="30%"><b><? echo $GLOBALS["tDel"]; ?></b></td>
<td width="40%"><b><? echo $GLOBALS["tImageName"]; ?></b></td>
<td width="15%"> </td>
<td width="15%"> </td>
</tr><?
$nImageNr = 0;
$nImageShowed = 0;
$savedir = getcwd();
chdir($GLOBALS["rootdp"].$GLOBALS["image_home"].$subdir);
if ($handle = @opendir('.'))
{
while ($file = readdir($handle))
{
$filename = $file;
if (is_file($filename))
{
$fileparts = pathinfo($filename);
$file_ext = $fileparts["extension"];
if (in_array($file_ext,$ImageFileTypes))
{
if ($nImageNr >= $lStartRec && $nImageShowed < $GLOBALS["RECORDS_PER_PAGE"])
{
?><tr bgcolor="#99CCFF">
<td align="center" valign="middle">
<? echo $iBlank; ?>
<a href="javascript:DelImage('subdir=<? echo $subdir; ?>&Image=<? echo $file; ?>&page=<? echo $HTTP_GET_VARS["page"]; ?>')"><? echo $iDelete; ?></a>
</td>
<td valign="top"><a href="javascript:ShowImage('<? echo $GLOBALS["rootdp"].$GLOBALS["image_home"].$subdir.$file; ?>')"><? echo $file; ?></a></td>
<td align="right" valign="top"><? echo display_size(filesize($file)); ?></td><?
$size = GetImageSize($filename);
$imagesize1 = $size["0"];
$imagesize2 = $size["1"]; ?>
<td align="center" valign="top"><? echo $imagesize1.' x '.$imagesize2; ?></td>
</tr><?
$nImageShowed++;
}
$nImageNr++;
}
}
elseif (is_dir($filename))
{
if ((($subdir != '') && ($filename != '.')) || (($subdir == '') && ($filename != '.') && ($filename != '..')))
{
if ($nImageNr >= $lStartRec && $nImageShowed < $GLOBALS["RECORDS_PER_PAGE"])
{
if ($filename != '..')
{
$newsubdir = $subdir.$filename.'/';
}
else
{
$dirbreakdown = explode('/',$subdir);
array_pop($dirbreakdown); array_pop($dirbreakdown);
$newsubdir = implode('/',$dirbreakdown).'/';
if ($newsubdir == '/')
{
$newsubdir = '';
}
}
?><tr bgcolor="#6699FF">
<td align="center" valign="middle"><?
if ($filename != '..')
{
?><a href="m_images.php?subdir=<? echo $newsubdir; ?>"><? echo $iOpenFolder; ?></a>
<a href="javascript:DelDir('subdir=<? echo $subdir; ?>&folder=<? echo $file; ?>&page=<? echo $HTTP_GET_VARS["page"]; ?>')"><? echo $iDelete; ?></a><?
}
?></td>
<td valign="top"><a href="m_images.php?subdir=<? echo $newsubdir; ?>"><? echo $filename; ?></a></td>
<td align="center" valign="middle"> </td>
<td align="center" valign="middle"> </td>
</tr><?
$nImageShowed++;
}
$nImageNr++;
}
}
}
closedir($handle);
}
chdir($savedir);
frmImagesHdFt(4,$nCurrentPage,$nPages);
?>
</table>
</body>
</html><?
} // function frmImages()
function lCountImages()
{
global $ImageFileTypes, $subdir;
$nImageCount = 0;
$savedir = getcwd();
chdir($GLOBALS["rootdp"].$GLOBALS["image_home"].$subdir);
if ($handle = @opendir('.'))
{
while ($file = readdir($handle))
{
$filename = $file;
if (is_file($filename))
{
$fileparts = pathinfo($filename);
$file_ext = $fileparts["extension"];
if (in_array($file_ext,$ImageFileTypes))
{
$nImageCount++;
}
}
elseif
(is_dir($filename))
{
if (($subdir != '') || ($filename != '..'))
{
$nImageCount++;
}
}
}
closedir($handle);
}
chdir($savedir);
return $nImageCount;
} // function lCountImages()
?>
<script language="Javascript">
function DelImage(sParams)
{
if(window.confirm('<? echo $GLOBALS["tConfirmDeletion"]; ?>'))
{
location.href='m_imagedel.php?' + sParams;
}
}
function DelDir(sParams)
{
if(window.confirm('<? echo $GLOBALS["tConfirmDeletion"]; ?>'))
{
location.href='removedir.php?' + sParams;
}
}
function ShowImage(sImageName)
{
window.open(sImageName, "Image", "width=500,height=400,status=no,resizable=yes,scrollbars=yes");
}
function UploadImage()
{
window.open("uploadimage.php?subdir=<? echo $subdir; ?>", "UploadImage", "width=600,height=310,status=no,resizable=no,scrollbars=no");
}
</script>
<?
function frmImagesHdFt($colspan,$nCurrentPage,$nPages)
{
global $subdir;
?>
<tr bgcolor="#FFFFFF">
<td colspan="<? echo $colspan; ?>" align="left">
<table height="100%" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="bottom">
<a href="javascript:UploadImage();"><? echo $GLOBALS["iAddNew"]; ?></a>
</td>
<td align="right" valign="bottom"><font face="Arial Black" size="1" color="#CC0000">
<a href="m_images.php?subdir=<? echo $subdir; ?>&page=0">
<? echo $GLOBALS["iFirst"]; ?>
</a>
<?
if ($nCurrentPage != 0)
{
?>
<a href="m_images.php?subdir=<? echo $subdir; ?>&page=<? echo $nCurrentPage - 1; ?>">
<? echo $GLOBALS["iPrev"]; ?>
</a>
<?
}
else
{
echo $GLOBALS["iPrev"];
}
$nCPage = $nCurrentPage + 1;
echo ' '.$GLOBALS["tPage"].' '.$nCPage.' '.$GLOBALS["tOf"].' '.$nPages.' ';
if ($nCurrentPage + 1 != $nPages)
{
?>
<a href="m_images.php?subdir=<? echo $subdir; ?>&page=<? echo $nCurrentPage + 1; ?>">
<? echo $GLOBALS["iNext"]; ?>
</a>
<?
}
else
{
echo $GLOBALS["iNext"];
}
?>
<a href="m_images.php?subdir=<? echo $subdir; ?>&page=<? echo $nPages - 1; ?>">
<? echo $GLOBALS["iLast"]; ?>
</a> </td>
</tr>
</table>
</td>
</tr><?
} // function frmImagesHdFt()
function display_size($file_size)
{
if ($file_size >= 1073741824)
{
$file_size = round($file_size / 1073741824 * 100) / 100 ."g";
}
elseif($file_size >= 1048576)
{
$file_size = round($file_size / 1048576 * 100) / 100 ."m";
}
elseif($file_size >= 1024)
{
$file_size = round($file_size / 1024 * 100) / 100 ."k";
}
else
{
$file_size = $file_size." bytes";
}
return $file_size;
} // function display_size()
?>