Answers for "upload files via php"


basic code for file upload in php

//This is the minimal code for an image upload for first time learners
//html portion
<!DOCTYPE html>
	<form action="upload.php" method="post" enctype="multipart/form-data">
		<input type="text" name="username">
		<input type="file" name='myfile'>
		<input type="submit" value="upload">
 //php portion
	echo "Hello $user <br/>";
	echo "File Name<b>::</b> ".$image['name'];

	//here the "photos" folder is in same folder as the upload.php, 
	//otherwise complete url has to be mentioned
Posted by: Guest on July-03-2020

Browse Popular Code Answers by Language