Here is what I have. I’m getting “Sorry, there was a problem uploading your file.”
[php]<?php
// Connects to your Database
mysql_connect(“inthisreviewcom.startlogicmysql.com”, “thisreview”, “destined1”) or die(mysql_error()) ;
mysql_select_db(“bands”) or die(mysql_error()) ;
//This is the directory where images will be saved
$target = “http://www.inthisreview.com/bandsreview/bandimages/”;
$target = $target . basename( $_FILES[‘photo’][‘name’]);
//This gets all the other information from the form
$value = $_POST[‘Name’];
$value2 = $_POST[‘website’];
$value3 = $_POST[‘Description’];
$photo = mysql_real_escape_string(htmlspecialchars($_FILES[‘photo’][‘name’]));
//Writes the information to the database
$sql = “INSERT INTO band (Name,website,Description,photo) VALUES (’$value’, ‘$value2’, ‘$value3’, ‘$photo’)”;
if (!mysql_query($sql)) {
die('Error: ’ . mysql_error());
}
if (!mysql_query($sql)) {
die('Error: ’ . mysql_error());
}
//Writes the photo to the server
if(move_uploaded_file($_FILES[‘photo’][‘tmp_name’], $target))
{
//Tells you if its all ok
echo “The file " . basename( $_FILES[‘uploadedfile’][‘name’]). " has been uploaded, and your information has been added to the directory”;
}
else {
//Gives and error if its not
echo “Sorry, there was a problem uploading your file.”;
}
?>
[/php]