only image icon shows up

For general web development questions that are not specifically related to CSS HTML Validator. This includes (but is not limited to) general HTML, CSS, Accessibility, JavaScript, and SEO questions.
BigBadJohn
Rank 0 - Newcomer
Posts: 4
Joined: Sat Oct 29, 2011 9:12 am

Images don't show up

Post by BigBadJohn »

I'm using php and myslqi data base and images that are referenced by the data base only show the little image icon and not the image!
it does show up when I transfer it to the web! the code I'm using is ```$staff_pic_file = mysqli_result($result, $x, 'staff_pic_file');```
followed by ``` echo "<img class='img-responsive' src = '$staff_pic_file' />";```
Any help would be appreciated, John
BigBadJohn
Rank 0 - Newcomer
Posts: 4
Joined: Sat Oct 29, 2011 9:12 am

only image icon shows up

Post by BigBadJohn »

I think this may be a double post as I entered all this info befor but it does not show up...sorry if it is.
I am working in php and mysqli and when i call up an image referenced by the data base it ony brings up an image icon and won't open the image!
this is the code I'm using ``` $staff_pic_file = mysqli_result($result, $x, 'staff_pic_file');```
```echo "<img class='img-responsive' src = '$staff_pic_file' />"; ```
It does open the image when I upload it to the web!
Thanks, John
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: only image icon shows up

Post by Albert Wiersch »

Hello,

Have you checked the server/PHP logs for messages that might be helpful?

What is the HTML source code that is being generated by the PHP that is showing the image icon?
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
BigBadJohn
Rank 0 - Newcomer
Posts: 4
Joined: Sat Oct 29, 2011 9:12 am

Re: only image icon shows up

Post by BigBadJohn »

Hi Albert,
This is the code I' am using to bring up the image and all it shows is a black image icon.

"<img class='img-responsive' src = '$staff_pic_file' />";
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: only image icon shows up

Post by Albert Wiersch »

Then $staff_pic_file must be a bad/invalid URL. What does $staff_pic_file equal when it doesn't work? And when it works?

Going to need a lot more information to debug. Without more detail, it will be very difficult to debug.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
BigBadJohn
Rank 0 - Newcomer
Posts: 4
Joined: Sat Oct 29, 2011 9:12 am

Re: only image icon shows up

Post by BigBadJohn »

Albert Wiersch wrote: Wed Nov 13, 2019 10:20 pm Then $staff_pic_file must be a bad/invalid URL. What does $staff_pic_file equal when it doesn't work? And when it works?

Going to need a lot more information to debug. Without more detail, it will be very difficult to debug.
Just got it figured out...

The upload file needs to be in the same directory as the main file showing the images...
You can't put it in an admin file and add ../uploads/etc.jpg because the file showing the jpg does not like the ,,/

John