Image displays as "No Image" thumbnail in web interface

Hi,

I am using the plaicart code provided by http://www.phpwebcommerce.com/, all is fine. I was able to configure the site and build the DB. Am using it on WAMP with MySQL as backend.

I’m encountering a lil issue though,when I’m adding a picture,it doesn’t display on the web page but it is stored on in the DB. Why is that so?I’ve checked the path and seems ok else the data would not have populated my DB “tbl_category”.

I’ve added the picture through the web interface itself in the product section and it is stored in the DB but on the web display it displays as “No Image” thumbnail.

Can you please assist me as am a bit new to php and am still learning it.

Thank you,
Rak

Hi Rak. Welcome to the forums. :slight_smile:

The image itself won’t be in the database but in a folder for files/images. Check the file path in your browser and see if it points to the location where the images are actually stored. If not, you probably need to change the on-page code (be it PHP-generated or whatever) to make sure it creates the correct file path.

What happens if you navigate to the " Admin - View Product " page?

All the pics seem to display fine for me.

The link provideded by the OP is to the code they are using not their acutal website :wink:

Thank you for your reponse.
When I go to the “Admin - View Product” I still get the thumbnail “No-Image”. I’ve even copied the image in the directory where it should be for “category”, i.e. “http://localhost/plaincart/images/category”. I added a category through the web interface itself by searching the new image I just copied in the location. When I check in the ‘tbl_category’ table the image is stored there.
Ralph.m, for you its working fine, have you tweak some path in the code?

Would really appreciate some help here as am stuck with it even after going through the all the relevant pages: “/plaincart/admin/category/add.php” , “/plaincart/admin/category/processCategory.php”.

I trust your know how and thank you in advance

What are the contents of these lines in /library/config.php

define(‘CATEGORY_IMAGE_DIR’,
define(‘PRODUCT_IMAGE_DIR’,

Nevermind… apparantly the code doesnt…use… that directory for the pictures. wtf.

What is the value of the pd_image in the database?

Hi StarLion,
Thank you for your quick response.

In the DB the image is stored as and md5 value.

For the URL of the image please find below the extract from the ‘view source’ of the page with this “No Image” display.


<td><a href=“index.php?catId=12”>Cars</a></td>

<td>Expensive and luxurious cars</td>

<td width=“75” align=“center”><img src=“/plaincart/images/category/dce08605333d805106217aaab7f93b95.jpg”></td>

<td width=“75” align=“center”><a href=“javascript:modifyCategory(12);”>Modify</a></td>

<td width=“75” align=“center”><a href=“javascript:deleteCategory(12);”>Delete</a></td>

</tr>

&lt;tr class="row1"&gt; 

<td><a href=“index.php?catId=25”>Laptop</a></td>

<td>Sony Vaio</td>

<td width=“75” align=“center”><img src=“/plaincart/images/no-image-small.png”></td>

<td width=“75” align=“center”><a href=“javascript:modifyCategory(25);”>Modify</a></td>

<td width=“75” align=“center”><a href=“javascript:deleteCategory(25);”>Delete</a></td>

</tr>

&lt;tr class="row2"&gt; 

<td><a href=“index.php?catId=13”>Manga</a></td>

<td>It’s all about manga, yay…</td>

<td width=“75” align=“center”><img src=“/plaincart/images/category/2a5d7eb60c1625144b3bd785bf70342c.jpg”></td>

<td width=“75” align=“center”><a href=“javascript:modifyCategory(13);”>Modify</a></td>

<td width=“75” align=“center”><a href=“javascript:deleteCategory(13);”>Delete</a></td>

</tr>

If you need the complete code for the ‘processCategory.php’ please do let me know because I guess the problem might come from here but am a novice.

Thank you in advance.

Hmm…

Just curiousity, does the MD5 for the “Laptop” image start with one or more 0’s and is followed by a letter?

Well,the md5 value for the images I save starts with an interger : “9aaa67…”
I dnt knw if that may help u, but I guess U had a good reason to have asked it.

Really appreciate your help.

I asked specifically about the one for Laptop for a reason:

the system you’re using does a simple if() check on the value, rather than an empty() check… If the value you are inputting starts with a 0 followed by a letter, PHP may be interpreting it as a 0, which means false, which means you’ll get the no-image image.

If the image is well saved as a md5 value in the DB, logically it’s storing it but why its not displaying? You think its the path in the coding “processCategory.php”?


$catImage = uploadImage(‘fleImage’, SRV_ROOT . ‘images/category/’);

Hierarchy of Admin Category: “plaincart/admin/category/processCategory.php”
Hierarchy of Image folder: "plaincart/images/category/ "

I modified the path but same result.

Thnx

I asked you for a specific piece of information.

What is the value of the MD5 for the image assigned to “Laptop”.

Laptop MD5 value: ‘9aaa67752127ce6f29be3b635a8c1961.jpg’

Hmm. Shouldnt have caused a failure then… and you’re certain this file exactly exists?
/plaincart/images/category/9aaa67752127ce6f29be3b635a8c1961.jpg

Am puzzled as well StarLion.

When using the URL: http://127.0.0.1/plaincart/images/category/9aaa67752127ce6f29be3b635a8c1961.jpg

NOT FOUND
The requested URL /plaincart/images/category/9aaa67752127ce6f29be3b635a8c1961.jpg was not found on this server

I copied the image in the folder and from there I added it DB, so it had to be here when the URL was typed.

Really thank you for your help.