• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

html help

Burnt

Platinum Member
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?
 


<< 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
 
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.
 
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?
 
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
 
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.
 
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.
 
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.
 
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 😀
 
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.
 


<< 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.
 
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.
 


<< 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
 
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....
 


<< 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.
 


<<

<< 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?
 
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
 
Back
Top