Gossamer Forum
Home : General : Perl Programming :

Background Color - How to add a BODY tag here ?

Quote Reply
Background Color - How to add a BODY tag here ?
Please help me .. i want to have a black background on this page ..
i want a BODY tag i tryed a lot but when i change something that comes that ugly 505Error Smile

Does someone know how to change the Backgroung from White to black ????
not the tables back just the body back ..

Please help me someone ..



Code:
# Begin Program.

$featuretitle = "<b><a href=\"$adminprogram?action=enter&password=$inpassword\">Admin Center</a>/ Create New List</b><p>";

print "Content-type: text/html\n\n";

&part1;

if ($inpassword eq "$adminpass") {

$output .= "$featuretitle\n";

opendir (MEMBERSDIR, "members");
@memberssdata = readdir(MEMBERSDIR);
closedir (MEMBERSDIR);

@sortedmembersdata = sort(@memberssdata);
@sortedmembersdata = grep(/txt/,@sortedmembersdata);

foreach $file (@sortedmembersdata) {
($important,$trash) = split (/\./,$file);
($memberid,$clickcount,$lasthit,$status) = split("-",$important);

$membersfile = "members/$memberid-$clickcount-$lasthit-$status.$trash";
open(FILE,"$membersfile");
flock(FILE,2);
@memberdata = <FILE>;
close(FILE);
($memberid,$membername,$memberurl,$contactname,$contactemail) = split(/\|/,@memberdata[0]);

$rearrange = ("$clickcount|$membername|$memberurl");
push(@newdata, $rearrange);
}

@sortdata = sort numerically (@newdata);
@sortdata = reverse(@sortdata);

$topsites .= "<table align=center width=\"$tablewidth\" cellpadding=\"2\" cellspacing=\"1\" border=\"0\">\n";
$topsites .= "<tr><td colspan=3 bgcolor=\"$tablecolor\">\n";
$topsites .= "<font size=\"2\" face=\"verdana,arial\">\n";
$topsites .= "<b>$title</b>\n";
$topsites .= "</td></tr>\n";

$topsites .= "<tr><td width=10%>\n";
$topsites .= "<font size=1 face=\"verdana,arial\">\n";
$topsites .= "Rang\n";
$topsites .= "</td><td width=75%>\n";
$topsites .= "<font size=1 face=\"verdana,arial\">\n";
$topsites .= "Website\n";
$topsites .= "</td><td width=100 align=center width=15%>\n";
$topsites .= "<font size=1 face=\"verdana,arial\">\n";
$topsites .= "HITS\n";
$topsites .= "</td></tr>\n";

$n = 1;
$realcount = 0;
$passhits = "";

for (@sortdata) {
($clickcount,$membername,$memberurl) = split(/\|/,$_);
if ($realcount <= $maxlinkpartners) {
unless ($clickcount eq "0") {
$topsites .= "<tr><td bgcolor=\"$tablecolor2\" width=10%>\n";
$topsites .= "<font size=2 face=\"verdana,arial\">\n";
$topsites .= "$n\n";
$topsites .= "</td><td bgcolor=\"$tablecolor2\" width=75%>\n";
$topsites .= "<font size=2 face=\"verdana,arial\">\n";
$topsites .= "<a href=\"$memberurl\">$membername</a>\n";
$topsites .= "</td><td bgcolor=\"$tablecolor\" width=100 align=center width=15%>\n";
$topsites .= "<font size=2 face=\"verdana,arial\">\n";
$topsites .= "$clickcount\n";
$topsites .= "</td></tr>\n";
$realcount++;
}
}
if ($clickcount eq "$passhits") {
$passhits = $clickcount;
}
else {
$n++;
}
}

$topsites .= "<tr><td colspan=3>\n";
$topsites .= "<font size=\"1\" face=\"verdana,arial\">\n";
$topsites .= "<a href=\"$adminurl/$joinprogram\">Deine URL hier?</a>\n";
$topsites .= "</td></tr>\n";

$timeisnow = time;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($timeisnow);
$mon++;
$ampm = "am";
if ($hour > 11) { $ampm = "pm"; }
if ($hour > 12) { $hour = $hour - 12; }
if ($hour == 0) { $hour = 12; }
if ($min < 10) { $min = "0$min"; }
if ($sec < 10) { $sec = "0$sec"; }
$lastupdate = "$hour:$min $ampm ET on $mon.$mday.$year";

$topsites .= "<tr><td bgcolor=\"$tablecolor\" colspan=3>\n";
$topsites .= "<font size=\"1\" face=\"verdana,arial\">\n";
$topsites .= "Letztes Update: $lastupdate\n";
$topsites .= "</td></tr>\n";

$topsites .= "<tr><td colspan=3 align=center>\n";
$topsites .= "<font size=\"1\" face=\"verdana,arial\">\n";
$topsites .= "Powered by <a href=\"http://www.indexfinger.com/\">Link Partner v3.1</a>\n";
$topsites .= "</td></tr>\n";
$topsites .= "</table>\n";

open(GETPAGE,"$viewtemplate");
flock(GETPAGE,2);
@templatepage = <GETPAGE>;
close(GETPAGE);

foreach $line (@templatepage) {
$body .= "$line";
}

$body =~ s/\$post/$topsites/;

open(NEWPAGE,">$listingpage");
flock(NEWPAGE,2);
print NEWPAGE "$body";
close(NEWPAGE);


$output .= "<b><u>Status Report</u></b><p>\n";

$output .= "<ul>\n";
$output .= "<li><b>New Link Partner List Created</b><p>\n";
$output .= "<a href=\"$listingurl\">Click here to view it</a><p>\n";
$output .= "</ul>\n";

}

else {
$wrongpass = "yes";
&adminpassform;
}

&part2;
print "$output";
exit;

Quote Reply
Re: Background Color - How to add a BODY tag here ? In reply to
This set of code is not writing the HTML headers --- either the content line being sent back to the browser, or the
<HTML><HEAD><TITILE></TITLE></HEAD><BODY>
set of tags, then the
</BODY></HTML> tags to close the file.

Those must be somewhere else. If you just want that page to have a black background, you'll have to modify the code to send a <body bgcolor='black'> instead of a <body> back to the program. That is *NOT* in the section of code you showed.

One other way is to wrap the entire block of code you showed in another table:

<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0>

This will seem to set the page to black, but might have a small margin.

Quote Reply
Re: Background Color - How to add a BODY tag here ? In reply to
 
Than look at this html .. open it with a text editor ..hehehe

there are NO body tags Smile Smile Smile

yere is the full html output ..

Code:
<table align=center width="700" cellpadding="2" cellspacing="1" border="0">
<tr><td colspan=3 bgcolor="#e8e8e8">
<font size="2" face="verdana,arial">
<b>Ultima Zone Link Partner</b>
</td></tr>
<tr><td width=10%>
<font size=1 face="verdana,arial">
Rang
</td><td width=75%>
<font size=1 face="verdana,arial">
Website
</td><td width=100 align=center width=15%>
<font size=1 face="verdana,arial">
HITS
</td></tr>
<tr><td bgcolor="#f8f8f8" width=10%>
<font size=2 face="verdana,arial">
1
</td><td bgcolor="#f8f8f8" width=75%>
<font size=2 face="verdana,arial">
<a href="http://www.yeah.ch">YEAH Informatik GmbH</a>
</td><td bgcolor="#e8e8e8" width=100 align=center width=15%>
<font size=2 face="verdana,arial">
5
</td></tr>
<tr><td colspan=3>
<font size="1" face="verdana,arial">
<a href="http://www.ultimazone.ch/anderes/link-partner/join.cgi">Deine URL hier?</a>
</td></tr>
<tr><td bgcolor="#e8e8e8" colspan=3>
<font size="1" face="verdana,arial">
Letztes Update: 9:36 am ET on 7.17.99
</td></tr>
<tr><td colspan=3 align=center>
<font size="1" face="verdana,arial">
Powered by <a href="http://www.indexfinger.com/">Link Partner v3.1</a>
</td></tr>
</table>


Quote Reply
Re: Background Color - How to add a BODY tag here ? In reply to
If that is the output to your browser, then the HTML code is *WRONG* It's incomplete. It doesn't conform to ANY specification.

What is the program that is sending that to the browser? Very often the header information (and the footer) is in the main file, or subroutine such as sub make_header
and sub make_footer.

Quote Reply
Re: Background Color - How to add a BODY tag here ? In reply to
It's LinkPartner v3.1 , the very new !

look at this page, open it: http://www.ultimazone.ch/...nk-partner/index.htm

there are really no body tags ..
if you have an older browser i don't think they can read it ..

Can i send the script to u ? Would u check it please ?

I really don't know what to do ...

Please help me ..
Quote Reply
Re: Background Color - How to add a BODY tag here ? In reply to
Looks like if you add some code after:

Code:
@sortdata = sort numerically (@newdata);
@sortdata = reverse(@sortdata);
$topsites .= "<table align=center width=\"$tablewidth\" cellpadding=\"2\" cellspacing=\"1\" border=\"0\">\n";

Code:
@sortdata = sort numerically (@newdata);
@sortdata = reverse(@sortdata);
$topsites .= "<HTML><HEAD><TITLE></TITLE></HEAD>";
$topsites .= "<BODY BGCOLOR=BLACK>";
$topsites .= "<table align=center width=\"$tablewidth\" cellpadding=\"2\" cellspacing=\"1\" border=\"0\">\n";

and after

Code:
$topsites .= "</td></tr>\n";
$topsites .= "</table>\n";

make it

Code:
$topsites .= "</td></tr>\n";
$topsites .= "</table>\n";
$topsites .= "</BODY></HTML>";



[This message has been edited by pugdog (edited July 17, 1999).]
Quote Reply
Re: Background Color - How to add a BODY tag here ? In reply to
Yes i will try it now ..

Thanx
Quote Reply
Re: Background Color - How to add a BODY tag here ? In reply to
WOW ! IT WORKS !!! Smile

HEH MAN UR SO COOOL !
THANX A LOT !

Now i can really do anything i want there ..
Add some Banner,meta tags or so ..

Smile
Thanx again for helping me out!
__________
by Rex