Ok so I get this error now…please help. My the code is below that, does it look correct?
Warning: move_uploaded_file(path/to/put/file/facebook_profile_logo_round.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /Applications/MAMP/htdocs/rockmyfashion/addposting.inc.php on line 41
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move ‘/Applications/MAMP/tmp/php/phpiE8EN4’ to ‘path/to/put/file/facebook_profile_logo_round.jpg’ in /Applications/MAMP/htdocs/rockmyfashion/addposting.inc.php on line 41
There was an error uploading the file, please try again!
Posted
Sorry, there was a problem posting your post
[php]$title = $_POST[‘title’];
$poster = $_POST[‘poster’];
$shortdesc = $_POST[‘shortdesc’];
$picture = file_get_contents($_FILES[‘picture’][‘tmp_name’]);
$picture = mysql_real_escape_string($picture);
if (trim($poster == ‘’))
{
echo “
Sorry, each posting must have a poster
\n”;
}else
{
$con = mysql_connect(“localhost”, “test”, “test”) or die(‘Could not connect to server’);
mysql_select_db(“fashion1”, $con) or die(‘Could not connect to database’);
$query = "INSERT INTO postings (title, shortdesc, poster, picture) " .
" VALUES (’$title’, ‘$shortdesc’, ‘$poster’, ‘$picture’)";
$result = mysql_query($query) or die(mysql_error());
if ($result)
$path = “path/to/put/file/”;
$path = $path . basename( $_FILES[‘picture’][‘name’]);
if(move_uploaded_file($_FILES[‘picture’][‘tmp_name’], $path))
{
echo "The file “. basename( $_FILES[‘picture’][‘name’]).
" has been uploaded”;
}
else
{
echo “There was an error uploading the file, please try again!”;
}
echo “
Posted
\n”;
else
echo “
Sorry, there was a problem posting your post
\n”;
}
[/php]