> Upload file using PHP ~ Online tutorial

Upload file using PHP

Upload file using PHP

HTML Coding

In this example .i will show How upload file using PHP.we are two program here.one is HTM and PHP program.

In the HTML file get the file and send to the PHP program using POST method.


<html>
<body>
<form action="upload.php" enctype="multipart/form-data" method="post">
Select the file to upload<input name="upload" type="file" />
</form>
</body>
</html>

PHP Coding


<?php
$uploadddr='upload/';
$uploadfile=$uploaddr.basename($_FILE[''file']['name']);
if(move_uploaded_file($_FILE['file']['tmp_name'].$uploadfile))
{
echo "file is valid";
}
else
{
echo "file uploading failed";
}?>


PHP Program Explaination:

In the PHP program will get the file stored in file called upload.You must create upload folder in your Computer.

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: