1

I have an image upload script as follows:

$product = $_POST['name'];
$detail = $_POST['detail'];
$price = $_POST['price'];
$class = $_POST['class'];
$category = $_POST['category'];
$name = $_FILES['image']['name'];
$tmpName  = $_FILES['image']['tmp_name'];


if ($name) {
    //start upload process
    $location = "images/" . $name;
    move_uploaded_file($tmpName, $location);
}


$query="INSERT INTO shop_products VALUES ('','$product','$location','$detail','$price','$class','$category','yes')";
$result=mysql_query($query) or die(mysql_error());

header("location: ../admin/index.php");

and the display of the image is as follows:

<img class="item-img" src="scripts/images/<? echo $image; ?>" />

As you can see if you go to ltyboards.com/boards, the document source provides the appropriate file name for the image, and the image does exist on the server, but nothing is displayed. Ideas?

1 Answer 1

2

It just looks like your path is wrong

scripts/images/images/

should be

scripts/images/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.