html help

Burnt

Platinum Member
Mar 20, 2001
2,211
0
0
I'm looking for a way to load my images with a black background without having to make a seperate html page (w/ black background) for each image. Anyone how I can do this?
 

Czar

Lifer
Oct 9, 1999
28,510
0
0


<< or you could use tables......

explain please...
>>


sorry if I explain for him, but if you are going to use tables then you are going to need one html file for each image
 

hx009

Senior member
Nov 26, 1999
989
0
0
I'm looking for a way to load my images with a black background without having to make a seperate html page (w/ black background) for each image. Anyone how I can do this?

If your server doesn't do any server side processing (php, asp, cold fusion, etc...), then you could do it on the client side by making one html page with some DHTML/Javascript that displays the image based on the window.location.href..... like:

http://somewhere.com/showimage.html?imagenumber=5

Where the javascript reads the imagenumber and displays the appropriate image. No, I don't have an example, but I know it's possible with some monkeying around.
 

911paramedic

Diamond Member
Jan 7, 2002
9,448
1
76
If you are just posting one picture on a page and want the black background, just specify black as the background color. It is easier and quicker than creating a table, unless that is the look you want.

Did you only want a small area with black and then the pic in the middle??

What, exactly, are you trying to do here?
 

911paramedic

Diamond Member
Jan 7, 2002
9,448
1
76
Open Notepad and insert this code:


<HTML>
<HEAD>
<title></title>
</HEAD>
<BODY bgcolor=black>

<IMG SRC="./YOURPICTURE.EXTENSION">

</BODY>
</HTML>





Where it says YOURPICTURE.EXTENSION put in the name of your picture, like yosemite.jpg
The picture you use for this has to be in the SAME directory as this file is for it to work.
Save the file with whatever name you want, like mypic.html, DO NOT FORGET TO NAME THE FILE WITH AN HTML, OR HTM extension.
You can save this file over and over with different names and pictures in the same directory if you want.

Hope that helps
 

hx009

Senior member
Nov 26, 1999
989
0
0
You can save this file over and over with different names and pictures in the same directory if you want.

You apparently missed the part of his post where he said:

without having to make a seperate html page (w/ black background) for each image.

Like I said..... he can do it serverside easily. If not, he's going to have to use DHTML/Javascript to do it client side to make it a one page deal.
 

Burnt

Platinum Member
Mar 20, 2001
2,211
0
0
I'm trying to do what Hx009 suggested. I have all of my images in my directory...and my page has a black background, so when people click on the image I want it to be a black background without having to create a seperate html file (w/ black bg) for each image I have.
 

911paramedic

Diamond Member
Jan 7, 2002
9,448
1
76
oops, my bad, hehe

Why don't you save yourself some trouble and just get some brainless web dev software so you can just drag and drop everything? It would be very fast and easy, and no coding.
 

911paramedic

Diamond Member
Jan 7, 2002
9,448
1
76
I just went to your website and now I see what you are trying to do. My suggestion with the html pages may be your only answer...
Just name the pages the same as your pics and it will go pretty fast.

I am out of other suggestions so I will shut up now :D
 

jpsj82

Senior member
Oct 30, 2000
958
0
0
do this with php -

make one new file named
disp-pic.php
then inplace of each link to see a picture put in the link
disp-pic.php?picid=name
where name is the name of the picture (without the .jpg, example for http://filebox.vt.edu/users/jalang1/messydesktop.jpg put http://filebox.vt.edu/users/jalang1/disp-pic.php?picid=messydesktop )

now the code for the disp-pic.php file.

<html>
<head><title></title></head>
<body bgcolor="black">
<?php
$pic = "http://filebox.vt.edu/users/jalang1/" . $picid . ".jpg";
?>
<img src="<?php echo $pic; ?>">

</body></html>

This should work - let me know if it doesn't.
edit:i took out the quotes around the $pic after echo - bolded above.
also fixed link above - again i bolded my mistake.
 

jpsj82

Senior member
Oct 30, 2000
958
0
0


<< wow thanks. I tried it, but it doesnt load the picture right >>

hmm, what type of server do you have - your own or your schools? because the server needs to have php installed, i assumed that vt.edu had php installed.
to me it looks like the page is being looked at by the server as an html page and not a php page.
 

Burnt

Platinum Member
Mar 20, 2001
2,211
0
0
it's my personal account on vt.edu. So I don't know what they allow or whatever. I don't know anything about PHP.
 

jpsj82

Senior member
Oct 30, 2000
958
0
0


<< it's my personal account on vt.edu. So I don't know what they allow or whatever. I don't know anything about PHP. >>

arrr
its a no go. see here

edit:link fixed
 

hx009

Senior member
Nov 26, 1999
989
0
0
wow thanks. I tried it, but it doesnt load the picture right

Hey man.... I think this is what you want... I'd put the code here, but the forums will probably strip or mess up the javascript.

http://206.183.9.188/code.htm?imgid=1

You can change the 1 at the end of the URL to anything 0 to 5..... i just threw this thing together really fast, so no 100% guarantee on browser compatibility, but it works in IE6.

p.s. you can just do a view source on the page to see what I did....
 

jpsj82

Senior member
Oct 30, 2000
958
0
0


<< wow thanks. I tried it, but it doesnt load the picture right

Hey man.... I think this is what you want... I'd put the code here, but the forums will probably strip or mess up the javascript.

http://206.183.9.188/code.htm?imgid=1

You can change the 1 at the end of the URL to anything 0 to 5..... i just threw this thing together really fast, so no 100% guarantee on browser compatibility, but it works in IE6.
>>

looks good to me. hey that 'invalid attribute passed' checker is pretty good.
 

b0mbrman

Lifer
Jun 1, 2001
29,470
1
81


<<

<< or you could use tables......

explain please...
>>


sorry if I explain for him, but if you are going to use tables then you are going to need one html file for each image
>>


You could change the cell background color in tables, can't you?
 

hx009

Senior member
Nov 26, 1999
989
0
0
You could change the cell background color in tables, can't you?

Whoa! What was that?! Oh, it was the point of this thread flying over your head!
rolleye.gif