wp+sql+image not goin in the folder
- by happy
this is my code for uploading image in database but image are going to the desird forlder...but when i m tryin to retrieve the images to diaplay,,they are not displayed..anyone help me......
$category=$_POST['category'];
$uploadDir = 'D:/xampp/htdocs/js/wordpress/wp-content/plugins/img/imagess/ ';
$fileName = $_FILES['Photo']['name'];
$tmpName = $_FILES['Photo']['tmp_name'];
$fileSize = $_FILES['Photo']['size'];
$fileType = $_FILES['Photo']['type'];
$filePath = $uploadDir . $fileName;
$result = move_uploaded_file($tmpName,$filePath);
if (!$result)
{
echo "Error uploading file";
exit;
}
if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
$filePath = addslashes($filePath);
}
global $wpdb;
//$insert=$wpdb->insert('images',array('image_name'=>$filePath,'cat_name'=>$category),array('%b','%s'));
$insert=$wpdb->insert('images',array('image_name'=>$filePath,'cat_name'=>$category));
$wpdb->insert('categories',array('cat_name'=>$category));
echo "Successfully Submitted";