$name = $_POST['name'];
$image = $_FILES['image'];
$location = $_POST['location'];
$category = $_POST['category'];
$username = $_POST['username'];
//$imageData =addslashes (file_get_contents($_FILES['image']['tmp_name']));
$imageData =addslashes (file_get_contents("http://zbatny.info/HOOT/amsek/prob/5.jpg"));
$image =$_FILES['image']['name'];
$type=$_FILES['image']['type'];
$file_tmp=$_FILES['image']['tmp_name'];
if(!is_writable("../../images/"))
echo('You cannot upload to the specified directory, please CHMOD it to 777.');
if(move_uploaded_file($imageData,"../../images/".$image))
{
//Tells you if its all ok
echo "The file ". basename( $_FILES['image']['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.";
}
//$insert = "INSERT INTO problems(Name,Description,Image, Location, Category, Username, Vote, Spam) VALUES ('" . $name . "','sherif sobhy','$image','0','0','" . $username . "','0','0')";
$query = mysql_query($insert);
if ($query)
{
echo "Thank You";
}
else
{
echo "Insertion failed";
}
Inline Code Example Here
i tried many paths but i can't insert so please anyone help me thanks in advanced but here to make sure that my php is right i upload i inserted it in my server and i give it the path