By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,771 Members | 1,858 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,771 IT Pros & Developers. It's quick & easy.

Please help me change color in my code

P: n/a
Hi there!
I was wondering if somebody could tell me how to edit the following
ASP code so that the text within the tables appears as Font Color
"00FF00". Right now it is appearing in BLACK and since I want the
background to be black, it kind of poses a problem. :0 Also, if
possible, could you tell me how to change the color of the spaces
inside the table?
Thanks in advance!
Chichi
HERE IS THE CODE:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY BGCOLOR="BLACK">

<FONT COLOR="00FF00" FACE="ADMUI3Lg">

<%
Function CleanStr(x)
CleanStr = Replace(x, "'", "''")
End Function

if Request.Form("doSearch") = "yes" and
len(Trim(Request.Form("mySearch") & "")) > 0 then
'Response.Write "|||" & Request.Form("mySearch") & "|||<BR>"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Mode = 3
Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" &
"C:\mydb.mdb"
if Request.Form("Type") = 1 then
'str = "select * from artist,cd,song where songlyrics LIKE ""*" &
CleanStr(Request.Form("mySearch")) & "*"" and song.cdid=cd.cdid and
artist.artistid=cd.artistid order by artist.artistid"
str = "select * from (song left join cd ON cd.cdid = song.cdid)
left join artist ON artist.artistid = cd.artistid where songlyrics
LIKE ""%%" & CleanStr(Request.Form("mySearch")) & "%%"""
'"select * from artist,cd,song where songlyrics LIKE ""%%" &
CleanStr(Request.Form("mySearch")) & "%%"" and song.cdid=cd.cdid and
artist.artistid=cd.artistid order by artist.artistid"

Set rst = Conn.Execute(str)

if rst.eof then
strOutput = "Nothing Found - " & str
else
'found songs.....

strOutput = "<table border=1><tr><td>Artist</td><td>Album
Name</td><td>Song Title</td></tr>"
while not rst.eof
strOutput = strOutput & "<tr><td>" & rst("ArtistName") &
"</td><td>" & rst("CDName") & "</td><td><a href=""lyrics.asp?a=" &
rst("SongID") & """>" & rst("SongName") & "</a></td></tr>"
rst.movenext
wend
rst.close
strOutput = strOutput & "</table>"
end if
else
if Request.Form("Type") = 2 then

str = "select * from (song left join cd ON cd.cdid = song.cdid)
left join artist ON artist.artistid = cd.artistid where
artist.artistname LIKE ""%%" & CleanStr(Request.Form("mySearch")) &
"%%"""
Set rst = Conn.Execute(str)
strOutput = "<table border=1><tr><td>Artist</td><td>Album
Name</td><td>Song Title</td></tr>"
while not rst.eof
strOutput = strOutput & "<tr><td>" & rst("ArtistName") &
"</td><td>" & rst("CDName") & "</td><td><a href=""lyrics.asp?a=" &
rst("SongID") & """>" & rst("SongName") & "</a></td></tr>"
rst.movenext
wend
rst.close
strOutput = strOutput & "</table>"

else
str = "select * from (song left join cd ON cd.cdid = song.cdid)
left join artist ON artist.artistid = cd.artistid where cd.cdname LIKE
""%%" & CleanStr(Request.Form("mySearch")) & "%%"""
Set rst = Conn.Execute(str)
strOutput = "<table border=1><tr><td>Artist</td><td>Album
Name</td><td>Song Title</td></tr>"
while not rst.eof
strOutput = strOutput & "<tr><td>" & rst("ArtistName") &
"</td><td>" & rst("CDName") & "</td><td><a href=""lyrics.asp?a=" &
rst("SongID") & """>" & rst("SongName") & "</a></td></tr>"
rst.movenext
wend
rst.close
strOutput = strOutput & "</table>"
end if

end if
set rst=nothing
conn.close
set conn=nothing
' str = "Select * FROM Song where SongLyrics=""*" &
CleanStr(Request.Form("mySearch")) & "*"";"
'Response.Write str
end if
%>

<form method="post" action="index.asp">
<INPUT id="mySearch" name="mySearch">
<input type="hidden" name="doSearch" value="yes">
<SELECT id=select1 name="Type">
<OPTION selected value=1>Lyrics</OPTION>
<OPTION value=2>Artist</OPTION>
<OPTION value=3>CD Title</OPTION>
</SELECT>
<INPUT id=submit1 type=submit value=Submit name=submit1>
</form>
<%=strOutput%><BR>
</FONT>
</BODY>
</HTML>
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
chichi wrote on 15 jan 2004 in microsoft.public.inetserver.asp.general:
I was wondering if somebody could tell me how to edit the following
ASP code so that the text within the tables appears as Font Color
"00FF00". Right now it is appearing in BLACK and since I want the
background to be black, it kind of poses a problem. :0 Also, if
possible, could you tell me how to change the color of the spaces
inside the table?


This is totally off topic, because ASP is serverside and has no colours!

Put this in your <head></head>:

<style>
table tr td {color:#00ff00;background-color:black;}
</style>

please follow up on a clientside NG

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2

P: n/a
"chichi" <ch***********@yahoo.com> wrote in message
news:81**************************@posting.google.c om...
.. . .
<FONT COLOR="00FF00" ...


should be

<FONT COLOR="#00FF00" ...

HTH,
Phill W.
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.