Location: PHPKode > projects > Simple E-document > simple_e_document_v_1_3/upload.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>simple e-document</title>
<style type="text/css">
<!--
.style7 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }
-->
</style>
</head>
<body class="style7">
<?


if (($_COOKIE['access'] == "1") ||  ($_COOKIE['access'] == "2") || ($_COOKIE['access'] == "3")){


include ("settings.php");


if ($enable_uploading=='0') { echo "File Uploading Has Been Disabled By Admin";  include ("footer.php"); die();}

if(!isset($_POST['op1'])) $_POST['op1']='';

$op1 = $_POST['op1'];

function upload_form(){
echo'<br><b>simple e-document<br><br>Upload File:</b><br><br><form action="upload.php" enctype="multipart/form-data" method="POST">
File to Upload: <input type="file" name="fileupload"><br><br>
<input type="hidden" name="op1" value="upload">
<input type="submit" value="Upload">
</form>';
}

function upload(){
global $path_in, $path_out;

if ($_POST['op']="newin"){
$file_dir = $path_in;
}

if ($_POST['op']="newin"){
$file_dir = $path_in;
}

 foreach($_FILES as $file_name => $file_array) {
 echo '<br><b>e-document for php<br><br>Upload File:</b><br><br>';
   print "folder to use: ".$file_dir."<br>\n";
   print "path: ".$file_array['tmp_name']."<br>\n";
 print "name: ".$file_array['name']." <font color=\"FF0000\">[copy/paste this (the file name) at the end of the <i>Path</i> in the <i>Submit New Document</i> form]</font>
<br>";
  print "type: ".$file_array['type']."<br>\n";
    print "size: ".$file_array['size']."<br>\n";
  
    if (is_uploaded_file($file_array['tmp_name'])) {
       move_uploaded_file($file_array['tmp_name'],"$file_dir/$file_array[name]") or die("<br><b><font color=\"FF0000\">Couldn't copy</font></b><Br><br>Close This Window.");
       echo '<br><b>file uploaded!</b><br><br>';
  }
}


	
}

switch($op1) {
    case "upload":
    upload();
    break;
	
	default:
    upload_form();
    break;
}
	
} else {

echo 'You have no access.';
die;
}

include ("footer.php");
?>
</body>
</html>
Return current item: Simple E-document