#native_company# #native_desc#
#native_cta#

File Version Management in PHP Page 5

By M. Murali Dharan
on January 14, 2004

Display_form() Function

This function is used to prompt the user to select the file from your local machine.

<?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 Exiting 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

}

?>