tru
tru

Reputation: 117

img not showing in html using php

Having a problem showing image in my code using php

I am using an image profile update, when I use an image tag the normal way using html it shows in the browser and when I view the page source it shows with a link as it should

 <img src="profile_images/profile/be2b496164.png"/> // underlined link

But when i echo it out using php

echo '<img scr="'. $user->data()->profile. '"/>';

The image stores in the proper file path correctly and it stores in the database correctly. But the image does not show in the browser. And when I view the page source it shows exactly as the normal html method but without the link

<img src="profile_images/profile/be2b496164.png"/> // no underlined link

I do not understand what the problem is... Any help is always appreciated

Upvotes: 0

Views: 108

Answers (1)

Funk Forty Niner
Funk Forty Niner

Reputation: 74217

As per OP's request to close the question:

There is a typo in your code:

echo '<img scr="'. $user->data()->profile. '"/>';
           ^^^

it should read as src instead of scr

echo '<img src="'. $user->data()->profile. '"/>';

Upvotes: 2

Related Questions