Search

PHP- Upload a file PDF Print E-mail
User Rating: / 0
PoorBest 
Programming - PHP
Wednesday, 02 June 2010 19:41

 


 

PHP program to upload a file on to the server.

<html>
<body>
<?php
if(isset($_POST['submit']))
{


$file_name = $_FILES["file"]["name"];
$path= "./upload/".$file_name;
move_uploaded_file($_FILES["file"]["tmp_name"],$path);
}
?>
<form name="form1" method="post" action="<?php $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data">
<input name="file" id="file" type="FILE" size="15">
<input type="submit" name="submit" value="Upload" >
</form>
</body>
</html> 

 



Add this page to your favorite Social Bookmarking websites
 
 

Add comment


Security code
Refresh

We have 72 guests online