home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / src / ASP / colors.asp < prev    next >
Encoding:
Text File  |  2001-06-08  |  3.1 KB  |  89 lines

  1. <%
  2. '*******************************************************
  3. '*     ASP 101 Sample Code - http://www.asp101.com     *
  4. '*                                                     *
  5. '*   This code is made available as a service to our   *
  6. '*      visitors and is provided strictly for the      *
  7. '*               purpose of illustration.              *
  8. '*                                                     *
  9. '* Please direct all inquiries to webmaster@asp101.com *
  10. '*******************************************************
  11. %>
  12.  
  13. <%
  14. Dim bgcolor, textcolor
  15. ' Get values from form and paste together into 2 - 6 character strings
  16. bgcolor = Request.Form("bg_red") & Request.Form("bg_green") & Request.Form("bg_blue")
  17. textcolor =  Request.Form("text_red") & Request.Form("text_green") & Request.Form("text_blue")
  18.  
  19. ' If the strings aren't 6 characters long then ignore them
  20. ' This means that not all the pull downs in the group had values entered
  21. If len(bgcolor) = 6 Then
  22.     bgcolor = " BGCOLOR=#" & bgcolor
  23. Else
  24.     bgcolor = ""
  25. End If
  26.  
  27. If len(textcolor) = 6 Then
  28.     textcolor = " COLOR=#" & textcolor
  29. Else
  30.     textcolor = ""
  31. End If
  32.  
  33. ' Now all that's left is to show our colorful message which is mostly just HTML
  34. %>
  35. <TABLE BORDER="1" CELLSPACING="3" CELLPADDING="5"<%= bgcolor %>>
  36.     <TR>
  37.         <TD VALIGN="CENTER"><STRONG><FONT SIZE="6"<%= textcolor %>>What color would you like today?</FONT></STRONG></TD>
  38.     </TR>
  39. </TABLE>
  40.  
  41. <!-- All the cool stuff is already done...Now we're just building the form -->
  42. <FORM ACTION="colors.asp" METHOD="POST">
  43. <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="3">
  44. <TR>
  45.     <TD> </TD>
  46.     <TD ALIGN="center">Red</TD>
  47.     <TD ALIGN="center">Green</TD>
  48.     <TD ALIGN="center">Blue</TD>
  49. </TR>
  50. <TR>
  51.     <TD>Background Color:</TD>
  52.     <TD>
  53.         <select NAME="bg_red">
  54.             <OPTION><%= Request.Form("bg_red") %></OPTION><OPTION>00</OPTION><OPTION>33</OPTION><OPTION>66</OPTION><OPTION>99</OPTION><OPTION>CC</OPTION><OPTION>FF</OPTION>
  55.         </select>
  56.     </TD>
  57.     <TD>
  58.         <select NAME="bg_green">
  59.             <OPTION><%= Request.Form("bg_green") %></OPTION><OPTION>00</OPTION><OPTION>33</OPTION><OPTION>66</OPTION><OPTION>99</OPTION><OPTION>CC</OPTION><OPTION>FF</OPTION>
  60.         </select>
  61.     </TD>
  62.     <TD>
  63.         <select NAME="bg_blue">
  64.             <OPTION><%= Request.Form("bg_blue") %></OPTION><OPTION>00</OPTION><OPTION>33</OPTION><OPTION>66</OPTION><OPTION>99</OPTION><OPTION>CC</OPTION><OPTION>FF</OPTION>
  65.         </select>
  66.     </TD>
  67. </TR>
  68. <TR>
  69.     <TD>Text Color:</TD>
  70.     <TD>
  71.         <select NAME="text_red">
  72.             <OPTION><%= Request.Form("text_red") %></OPTION><OPTION>00</OPTION><OPTION>33</OPTION><OPTION>66</OPTION><OPTION>99</OPTION><OPTION>CC</OPTION><OPTION>FF</OPTION>
  73.         </select>
  74.     </TD>
  75.     <TD>
  76.         <select NAME="text_green">
  77.             <OPTION><%= Request.Form("text_green") %></OPTION><OPTION>00</OPTION><OPTION>33</OPTION><OPTION>66</OPTION><OPTION>99</OPTION><OPTION>CC</OPTION><OPTION>FF</OPTION>
  78.         </select>
  79.     </TD>
  80.     <TD>
  81.         <select NAME="text_blue">
  82.             <OPTION><%= Request.Form("text_blue") %></OPTION><OPTION>00</OPTION><OPTION>33</OPTION><OPTION>66</OPTION><OPTION>99</OPTION><OPTION>CC</OPTION><OPTION>FF</OPTION>
  83.         </select>
  84.     </TD>
  85. </TR>
  86. </TABLE>
  87. <INPUT TYPE="submit" VALUE="Colorize Me!">
  88. </FORM>
  89.