only image icon shows up

Discussion about any web related scripting languages like JavaScript, ASP, and PHP.
Post Reply
BigBadJohn
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 4
Joined: Sat Oct 29, 2011 9:12 am

Images don't show up

Post by BigBadJohn » Wed Nov 13, 2019 8:45 am

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
Rank 0 - Newcomer
Posts: 4
Joined: Sat Oct 29, 2011 9:12 am

only image icon shows up

Post by BigBadJohn » Wed Nov 13, 2019 9:12 am

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
Site Admin
Posts: 3453
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: only image icon shows up

Post by Albert Wiersch » Wed Nov 13, 2019 10:32 am

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?
Image
Albert Wiersch

BigBadJohn
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 4
Joined: Sat Oct 29, 2011 9:12 am

Re: only image icon shows up

Post by BigBadJohn » Wed Nov 13, 2019 7:46 pm

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
Site Admin
Posts: 3453
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: only image icon shows up

Post by Albert Wiersch » 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.
Image
Albert Wiersch

BigBadJohn
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 4
Joined: Sat Oct 29, 2011 9:12 am

Re: only image icon shows up

Post by BigBadJohn » Thu Nov 21, 2019 6:33 pm

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

Post Reply