Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Images not appearing on site php/msql

Status
Not open for further replies.

msdbsql

Technical User
Nov 22, 2004
39
US
I have contacted the hosting agent and they informed me that this is not a hosting problem.

I have a site using PHP/MYSQL 4.x

I have a web page that based on selections will display a page of check boxes.

Navigation:
Selection Page
select any of the radio buttons
on the next page you will see image names with check boxes
check up to 4 <submit>
No images appear, just outlines or blank boxes.

If this is a code problem where should I be looking?

the images are stored at the fileserver level

\images\mens\level1\level2
\images\women\level1\level2


the query used to bring the image up (selection page) uses the image ID that is stored in the image table; it has the path to the image.
 
are you sure about the path to your images? I don't thing they are correct. Post a piece of code where the images are displayed.
 
That's an error on my part. The path I wrote is where it is stored on my workstation. The actual path for the images in mysql is

/images/mens/level1/Eagle.gif

the selection page code for one of the check boxes:

<td valign=top height=20 class=body3><input type=checkbox name=shoes[] value="/images/mens/level1/eagle.gif">eagle</td>
</tr><tr>

This is how it stored in the database. thanks
 
no it was incorrect in the posting. But the code is correct, this is the original problem. Images do not show.
 
Additional info

The chmod is currently set to 755. Should it be set to something else? This is on the images directory where the files are stored.

For the scripts it is set to 644, should this be 755?

Here is a portion of the script

$result = mysql_query("SELECT DISTINCTROW products.product_id, products.product_name, images.product_image, products.gender, products_to_info.info_id
FROM (products INNER JOIN products_to_info ON products.product_id = products_to_info.product_id) INNER JOIN images ON products.product_id = images.product_id WHERE (((products.gender)=$gender) AND ((products_to_info.info_id)=$info))", $dbh);


if ($myrow = mysql_fetch_array($result)) {
echo "<table cellpadding=0 cellspacing=0 border=0>\n";
do {
echo "<tr>\n\t<td valign=top height=20><input type=checkbox name=shoes[]";
echo " value=\"$myrow[product_image]\">";
echo "$myrow[product_name]</td>\n</tr>";
} while ($myrow = mysql_fetch_array($result));
echo "\t</table>";
} else {
echo "Sorry, no records were found";

} ?></td>
</tr>
 
/images/mens/level1/Eagle.gif

the selection page code for one of the check boxes:

<td valign=top height=20 class=body3><input type=checkbox name=shoes[] value="/images/mens/level1/eagle.gif">eagle

If this is on a linux/apache server (or maybe just apache) I have noticed that it is very sensitive about case (vs. MS IIS). Try changing the case of eagle.gif in the HTML to Eagle.gif to match the file stored on the server.
 
The syntax of the the images files match exactly with the file name on the server and how the file path is stored in the image table.

The gif file names were edited for this example. But in reviewing the database and the code, they are the same and have the same case.

I don't know for certain what type server it is; probably LINUX.

Even on the file names that have mixed case, the images do not appear.

What else should I check?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top