view raw
Jen Jen - 6 months ago 28
PHP Question

Image not showing in php with html

We have am html code saved as .php because it includes a form that requires php. However, the image we've inserted isn't displaying on the browser while everything else is.
Here's our coding:

<IMG SRC = "D:\xampp\htdocs\1.jpg" width = "650" height = "400">

We also tried this :

$media = fopen("1.jpg", 'r');
echo $media;

However, it returns "resource id #3" and I don't know how/what else to do to display the image.

Please help.


if your script is inside a folder in htdocs folder USE

<IMG src="../1.jpg" width = "650" height = "400">

else if your script is inside htdocs folder USE

<IMG src="1.jpg" width = "650" height = "400">