- 1). Type the following into your file to create the user upload form:
<form enctype="multipart/form-data" action="upload_photo.php" method="POST">
Choose Image: <input name="userfile" type="file" /><br />
<input type="submit" value="Upload Photo" />
</form>
Save the file, for example "upload_photo.html." - 2). Open a new file to create the PHP file needed to execute the "action" for the form. Type the following:
<?php
$ path = "profiles/photos";
$path = $path . basename( $_FILES['userfile']['name']);
if(move_uploaded_file($_FILES['userfile']['tmp_name'], $path)) {
echo "Successful upload of ". basename($_FILES['userfile']['name']);
} else{
echo "Error when uploading the file.";
}
?>
Save your file using "upload_photo.php" as the file name. - 3). Upload both the HTML and PHP files to your server. Test the form by navigating to your upload form Web page.
Tags
PHP
Programming
C C++
ASP
Development Tools
Ajax
XML
Javascript
Python
VB
VC
perl
dephi
Ruby
sql
technology
Microsoft Access
Excel
ffice
Powerpoint
Word
Oracle
Related Posts "Technology"
-
Business Presentations…Make them Effective with right PPT Templates
7/11/2019 3:02:00 PM
You might also like on "Technology"
How To Build A Website Using WordPress In Ten Minutes
7/10/2019 8:05:00 PM
Website Creation Utilizing Search Engine Optimisation Under Consideration
7/10/2019 6:35:00 PM
Useful WordPress Website Design Tips
7/10/2019 3:19:00 PM
Barricades Involved In Mobile Application Testing
7/10/2019 1:27:00 PM
Hire PHP Developers India for Efficient PHP Web Development
7/10/2019 10:54:00 AM
Changing Your Logo Seamlessly
7/9/2019 8:22:00 PM
Are You Loan-Worthy? 5 Ways to Improve the Odds of Acceptance
7/9/2019 8:03:00 PM
Relevance Of Custom Website Design For Niche Audience
7/9/2019 7:30:00 PM
You Must Understand and Use Responsive Web Design
7/9/2019 4:51:00 PM
Web Design Development: A Dime a Dozen
7/9/2019 3:33:00 PM
A Great Way To Start Earning Money Online Is With An Affiliate Site
7/8/2019 4:43:00 PM