tags:

views:

53

answers:

1

Hi, I am new to this.please help me out how to upload a file using html and php.please help me out with some examples.Thanks in advance.

A: 

try this is from tizag website... referencing borealid commecnt

$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";
}
Jaison Justus