Click to See Complete Forum and Search --> : Images not displaying after upload


qbmike
07-26-2009, 11:09 AM
Hi all.

I'm new to web programming and I am wondering what it takes to display an image on a website...

If I were to write this simple code and then upload it to the public directory along with the image it is supposed to display shouldn't it work? Or is it the free web hosting that I'm using, I've tried this at 2 different sites.


<html>
<body>
<p>This is an image</p>
<img src="p.jpg" />
<body>
<html>


The code was uploaded as "test.htm"
The image was uploaded as "p.jpg"
This works great off my desktop.

Thanks,
Mike

salmanshafiq
07-26-2009, 11:34 AM
Please check first with http://yoursite.com/p.jgp This for check your image is uploaded correctly or not.

6StringGeek
07-26-2009, 11:55 AM
You also need to close your body and html tags:

</body>
</html>

qbmike
07-26-2009, 01:11 PM
My page is located at http://ekimyespoc.hostzi.com/test.htm


when I try:
http://ekimyespoc.hostzi.com/public_html/p.jpg

I get an error page:
http://error.**********.com/

Charles
07-26-2009, 04:00 PM
You also need to close your body and html tags:

</body>
</html>That's not true at all, but you do need to get rid of the double start tags for those. Or better yet, just get rid of them altogether. They're not needed. You have a few other things wrong there but your immediate problem is that the internet is case sensitive. Try:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example</title>
<div>
<img alt="" src="http://ekimyespoc.hostzi.com/p.JPG">
</div>And make friends with The Validator (http://validator.w3.org).

6StringGeek
07-26-2009, 05:27 PM
That's not true at all, but you do need to get rid of the double start tags for those.

It's also hooey that we need to give 2 seconds care to creating accessible websites, but we still do (or at least attempt to). It's just good practice IMHO...you crack me up! :)

Charles
07-26-2009, 05:48 PM
It's just good practice IMHOI'll admit that I always use those tags but there are enough real rules that we don't need to go making up new ones.

6StringGeek
07-26-2009, 06:13 PM
I once read that google doesn't close body or html in order to keep their pages as small as possible...i just went and checked their search page and sure enough.

qbmike
07-26-2009, 09:30 PM
Thanks Charles. I didn't realize that I needed the <!DOCTYPE> etc, declarations in my script. Thought that was for XML, w3schools didn't make that clear, but still a great place to learn. My original script ran fine by itself on my desktop, must not need the extras for that.

I know Basic like the back of my hand and some C, Assembly, and VB but I am spanking new to HTML. I read through W3's Java section once and scored 80% on their test!

Well, I'm off to build my first web page, (maybe!).

Thanks lots,
Mike