Posts

Showing posts from September 9, 2018

Simple File Upload Using PHP

Image
File Upload Using PHP <! DOCTYPE html > < html > < head > < title >Upload your files</ title > </ head > < body > < form enctype = " multipart/form-data " action = " upload.php " method = " POST " > < p >Upload your file</ p > < input type = " file " name = " uploaded_file " ></ input >< br /> < input type = " submit " value = " Upload " ></ input > </ form > </ body > </ html > <?PHP if ( ! empty ( $_FILES [ ' uploaded_file ' ])) { $path = " uploads/ " ; $path = $path . basename ( $_FILES [ ' uploaded_file ' ][ ' name ' ]); if ( move_uploaded_file ( $_FILES [ ' uploaded_file ' ][ ' tmp_name ' ], $path )) { echo " The file " . basename ( $_FILES [ ' uploaded_fil