oh sorry the file didnt attach properly.
here is the code
<?php
function display_form($errMsg){
global $dir_path;
?>
<html>
<head><title>File Manager</title></head>
<body bgcolor="#E5E5E5">
<div align="center">
<h4>File Manager</h4>
<?php
if($errMsg){
?>
<font face="verdana, helvetica" size="2" color="red"><?php echo $errMsg ?></font>
<?php
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" method="POST">
<table border="1">
<tr>
<th>File Location:</th>
<th><input type="file" name="up_file" /></th>
</tr>
<tr>
<th colspan="2"><br><input type="checkbox" name="replace" value="1">
Replace Existing File*</th>
</tr>
<tr>
<th colspan="2"><br><input type="submit" name="upload" value="Upload File !" /></th>
</tr>
</table>
<br><font face="verdana, helvetica" size="1" color="#808080">* - Clicking this option will replace the existing file</font>
<br><font face="verdana, helvetica" size="1" color="#808080"><a href="file_display_manager.php">File Manager</a></font>
<br><font face="verdana, helvetica" size="2" color="#4A4A4A"><? if ($status){ echo "Result :".$status; }?></font>
<p><br><font face="verdana, helvetica" size="2" color="#808080"><b>Folder Location:</b><? echo $dir_path ?></font>
<br><font face="verdana, helvetica" size="1" color="#808080">You can change this location by editing the file</font>
</form>
</div>
</body>
</html>
<?php
}
?>
for the upload part i have
<?
$dir_path="C:\Program Files\Apache Group\Apache\htdocs\filemanager";
?>
<?php
function Get_New_File_Name($file_name)
{
$sqlQuery="SELECT file_image_name
FROM file_manager
WHERE file_name LIKE '$file_name%'
AND file_parent_id=1";
$fResult=mysql_query($sqlQuery);
$Last_Version=0;
$ver=0;
if(mysql_num_rows($fResult)){
while($fRow=mysql_fetch_array($fResult)){
list($junk,$ver)=explode("_VERSION",$fRow['file_image_name']);
list($ver,$extn)=explode(".",$ver);
$Last_Version = $Last_Version > $ver ? $Last_Version : $ver;
}
}else{
$new_file_name =$file_name."_VERSION".++$Last_Version;
return $new_file_name;
}
if($Last_Version !=0){
$new_file_name=$file_name."_VERSION".++$Last_Version;
return $new_file_name;
}
}
?>
<?php
function File_Size($size)
{
if($size > 104876){
return $return_size=sprintf("%01.2f",$size / 104876)." Mb";
} elseif($size > 1024){
return $return_size=sprintf("%01.2f",$size / 1024)." Kb";
} else {
return $return_size=$size." Bytes";
}
}
?>
this doesnt seem to work ?where does the problem lie?