how can we upload file using php?

how can we upload file using php?

$img_name=$_FILES["pimage"]["name"];
$randomizer = rand(0000, 9999);
    $file_name = $randomizer.$img_name;
	move_uploaded_file($_FILES["pimage"]["tmp_name"], "productimage/" . $file_name);

pimage means your field name. productimage means your directoryname to store images

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.