Does anyone know any good tutorial on how to upload a file with php and save the files path to a sql server?
From http://www.w3schools.com/php/php_file_upload.asp
HTML
PHP
0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "
";
}
else
{
if (file_exists("upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; //<- This is it
}
}
?>
Note that to upload the file you need to specify the path to save the file. If you save the file you already know it path.