1
<?php
$output_dir = "uploads/";
if(isset($_FILES["myfile"]))
{
//Filter the file types , if you want.
if ($_FILES["myfile"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br>";
}
else
{
//move the uploaded file to uploads folder;
move_uploaded_file($_FILES["myfile"]["tmp_name"],$output_dir. $_FILES["myfile"]["name"]);
echo "Uploaded File :".$_FILES["myfile"]["name"];
}
}
?>
This is my upload code, I’m not able to make it give the link after finishing the upload , I tried the code below and could not get the link... I’m still learning php so I’d like to know exactly what’s wrong...
echo "<a src='$_SERVER["DOCUMENT_ROOT"];".$_FILES["myfile"]["name"].>" Link "<a />";