I am making a php script to automatically save any files someone uploads to the website to a database. So, if there is an issue with saving the file to the database it creates an output that says that there is an error. When I test the script it says this on the page.
Parse error: syntax error, unexpected 'echo' (T_ECHO) in C:\xampp\htdocs\index.php on line 31
Does anyone know how to fix this because i really want to finish this website!
Here is the whole if command.
// file properties
$file = $_FILES['image']['tmp_name'];
if (!isset($file))
echo "Please Select An Image";
else
{
$image = file_get_contents($_FILES['image']['tmp_name']);
$image_name = addslashes($_FILES['image']['name']);
$image_size = getimagesize($_FILES['images']['tmp_name']);
if ($image_size==FALSE)
echo "The Specified File Is Not A Picture.";
else
{
if (!$insert = mysql_query("INSTERT INTO image VALUES ('', '$image_name', '$image')")
echo "Upload Error.";
else
{
$lastid = mysql_insert_id();
echo "Image Uploaded.<p />Your Image:<p /><img src=get.php>";
}
}
}