Zend - The PHP Company




File Uploading

Add Code


File Upload  

Type: application
Added by: loudufrane
Entered: 23/04/2004
Last modified: 04/12/2003
Rating: ** (3 votes)
Views: 7768
This is a simple Upload form for your users. It allows the user to enter their name, and after the upload is successfull it will send you an email notice including, name, IP, Date and the file uploaded. It is also fully customizable with CSS. You will only need to change the email value, it is marked with a comment.


<!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>

<!-- COPYRIGHT INFO, PlEASE READ BEFORE PROCEEDING WITH THE SOURCE CODE!

This PHP Script/document created by Lou Dufrane..
http://www.dufranetech.com 
Please do not remover this copyright notice-->


<title>File Uploads</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<style type="text/css" media="all">
.box{
background: #eeeeee; font-size:10px; font-family:verdana; width: 500px; height:auto; padding:20px; border:1px solid #000; margin:0 auto;border-bottom:50px solid #000;}
</style>
</head>

















<body style=" margin:0 auto; background: #999999">
<div class="box">

  <p><font color="#333333" size="7" face="Georgia, Times New Roman, Times, serif"> 
    File Uploads</font> <br />
    <font color="#003399" size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
    <strong>&rarr; </strong> Thank you for using File Uploads..</font><br />
  <br />
  </font></p>
<p> 
  <?php
$Time 
date("H:i dS F");
$Mail = ("na@na.com"); #Edit this!! Place your email here..
if ($File) {
    print(
"<b>File Name</b>:<u> $File_name </u><p>n");
    print(
"<b>File Size</b>:<u> $File_size </u><p>n");
    if (
copy ($File"uploads/$File_name")){
    print (
"Thank You <b> $Name </b>! Your File was successfully uploaded & notification has been sent to the <b>Administrator</b>. <br> Would you like to upload another?<p>n");
    
mail("$Mail""Notice: File Upload""IP: $REMOTE_ADDR - at $Time  -  $Name Uploaded $File_name to the Acplayers Directory <p> $Comment</p>n");
    print(
"<p><a href="uploads/$File_name"> View your File Now </a></p>n");
    }else{
    print (
"Sorry $Name ! Your File was not uploaded. Please contect Administrator.<p>n");
    }
    
unlink($File);
    }
    

    print(
"<Form action="fileupload.php" METHOD=Post ENCTYPE="multipart/form-data">n");
    print(
"Your Name<INPUT TYPE=TEXT NAME="Name" Size=20> <br>n");
    print(
"Comment? <INPUT TYPE=TEXT NAME="Comment" Size=20> <br>n");
    print(
"<p>File : <INPUT TYPE=FILE NAME="File" Size=40> <br>n");
    print(
"<INPUT TYPE=SUBMIT NAME="submit" VALUE="Upload"></FORM>n");
    
?>
</p>  
  
  <p align="center">
    
    
    <!-- You Must not remove this-->
    Script by <a href="http://lou.dufranetech.com">Lou dufrane</a><br />
    <br />
  </p>
</div>
</body>
</html>


Usage Example




Rate This Script





Search



This Category All Categories