I have problem displaying my image after I upload my coding to online web hosting. When I do in my localhost, I the image manage to retrieve out and manage to move to the accessory folder. But when I try in online, the image upload do not move to the accessory folder that store the image and cannot be retrieve out. Below is my code:
adminadd.php
<?php
session_start();
$connect = mysqli_connect("localhost", "root", "", "db_name");
if(isset($_POST['submit'])){
$name=$_POST['name'];
$description=$_POST['description'];
$image = $_FILES['image']['name'];
$image_temp = $_FILES['image']['tmp_name'];
move_uploaded_file($image_temp,"accessory/".$image);
$price=$_POST['price'];
$category=$_POST['category'];
$query="INSERT INTO product (name,product_description,price,catid,image) VALUES ('$name','$description','$price','$category','$image')";
if(mysqli_query($connect, $query)){
echo "<script>alert('Successfully inserted')</script>";
}
}
?>
Can someone enlighten me with my problem. Appreciate alot.