...

font and color.

Triss
08-16-2002, 06:33 AM
I'm trying to modify a cgi script searching my site (it's from http://www.scriptarchive.com/ ).
My question would be if it is possible to format if (font and color) with css, or if not how you add font and color information.

sub return_html {
print "Content-type: text/html\n\n";
print "<html>\n <head>\n <title>Results of Search</title>\n </head>\n";
print "<body>\n <center>\n <h1>Results of Search in $title</h1>\n </center>\n";
print "Below are the results of your Search in no particular order:<p><hr size=7 width=75%><p>\n";
print "<ul>\n";
foreach $key (keys %include) {
if ($include{$key} eq 'yes') {
print "<li><a href=\"$baseurl$key\">$titles{$key}</a>\n";
}
}
print "</ul>\n";
print "<hr size=7 width=75%>\n";
print "Search Information:<p>\n";
print "<ul>\n";
print "<li><b>Terms:</b> ";
$i = 0;
foreach $term (@terms) {
print "$term";
$i++;
if (!($i == @terms)) {
print ", ";
}
}
print "\n";
print "<li><b>Boolean Used:</b> $FORM{'boolean'}\n";
print "<li><b>Case $FORM{'case'}</b>\n";
print "</ul><br><hr size=7 width=75%><P>\n";
print "<ul>\n<li><a href=\"$search_url\">Back to Search Page</a>\n";
print "<li><a href=\"$title_url\">$title</a>\n";
print "</ul>\n";
print "<hr size=7 width=75%>\n";
print "Search Script written by Matt Wright and can be found at <a href=\"http://www.scriptarchive.com/\">Matt's Script Archive</a>\n";
print "</body>\n</html>\n";

pager
08-16-2002, 08:20 AM
First, learn something about css and html. Get an appropriate HTML editor to train yourself with it. Basic colors and stuff should be a no-brainer to you if you're delving into perl/cgi; (ie, look up the terms bgcolor... etc...

Second, try to get a book and learn the basics of perl/cgi... and at least learn the function of printing free text to output to a browser in the following fashion so you can copy and paste your web page format to your script without a lot of print statements...
(pay attention to the print qq~text here~; statements, and look it up in a perl reference somewhere).

print "Content-type: text/html \n\n";
print qq~<html> <head> <title>Results of Search</title>
<STYLE TYPE="text/css">
<!--
{text-align: justify}
A:link{text-decoration: none; color: Blue; font-weight: bold;}
A:visited{text-decoration: none; color: Blue; font-weight: bold;}
A:active{text-decoration: underline; color: Red; font-weight: bold;}
A:hover{text-decoration: underline; color: Red; font-weight: bold;}
.NVerdana {font-family: verdana; font-size: 10pt}
.NArial {font-family: arial; font-size: 10pt}
.NArialL {font-family: arial; font-size: 12pt}
.NArialS {font-family: arial; font-size: 8pt}
.NArialW {COLOR: #FFFFFF; font-family: arial; font-size: 10pt}
-->
</STYLE>
</head>
<body bgcolor="606060"> <center><h1>Results of Search in $title</h1></center> <br><br>
Below are the results of your Search in no particular order:<p><hr size=7 width=75%><p><ul>~;
########################
foreach $key (keys %include) {
if ($include{$key} eq 'yes') {
print qq~<li><a href="$baseurl$key">$titles{$key}</a> <br>~;}
}
print qq~</ul><br><hr size=7 width=75%>Search Information:<p><ul><li><b>Terms:</b>~;
#########################
$i = 0;
foreach $term (@terms) {print "$term";
$i++;
if (!($i == @terms)) {print ", ";}
}
#########################
print qq~<li><b>Boolean Used:</b> $FORM{'boolean'}<br>
<li><b>Case $FORM{'case'}</b> <br></ul><br><hr size=7 width=75%><P> <ul><li><a href="$search_url">Back to Search Page</a> <li><a href="$title_url">$title</a></ul><br>
<hr size=7 width=75%><br>
Search Script written by Matt Wright and can be found at <a href="http://www.scriptarchive.com">Matt's Script Archive</a><br></body></html>~;

-------------------------------------------------------------------------
it may not be syntactically correct but at least it'll give you a starting point to pursue.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum