Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.5 KiB

  1. <%@ LANGUAGE = PerlScript%>
  2. <HTML>
  3. <HEAD><TITLE>Request Object</TITLE></HEAD>
  4. <BODY> <BODY BGCOLOR=#FFFFFF>
  5. <!--
  6. ActiveState PerlScript sample
  7. PerlScript: The coolest way to program custom web solutions.
  8. -->
  9. <!-- Masthead -->
  10. <TABLE CELLPADDING=3 BORDER=0 CELLSPACING=0>
  11. <TR VALIGN=TOP ><TD WIDTH=400>
  12. <A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="ActiveState PerlScript" BORDER=0></A><P>
  13. </TD></TR></TABLE>
  14. <H3>Web Forms Example</H3><P>
  15. <%
  16. my($name) = $Request->Form('Yourname')->Item();
  17. $name = $Server->HTMLEncode($name);
  18. %>
  19. <%
  20. if($name eq 'Enter Your name here') {
  21. $Response->Write("Please type your name in the box below and then press the button");
  22. }
  23. else {
  24. $Response->Write("Hello $name");
  25. }
  26. %>
  27. <CENTER>
  28. <FORM ACTION="wform.asp" METHOD="POST">
  29. <INPUT TYPE="Textfield" NAME="Yourname" MAXLENGTH="30" VALUE="Enter Your Name Here">
  30. <INPUT TYPE="SUBMIT" VALUE="Click Me">
  31. </FORM>
  32. </CENTER>
  33. <!-- +++++++++++++++++++++++++++++++++++++
  34. here is the standard showsource link -
  35. Note that PerlScript must be the default language --> <hr>
  36. <%
  37. $url = $Request->ServerVariables('PATH_INFO')->item;
  38. $_ = $Request->ServerVariables('PATH_TRANSLATED')->item;
  39. s/[\/\\](\w*\.asp\Z)//m;
  40. $params = 'filename='."$1".'&URL='."$url";
  41. $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  42. %>
  43. <A HREF="index.htm"> Return </A>
  44. <A HREF="showsource.asp?<%=$params%>">
  45. <h4><i>view the source</i></h4></A>
  46. </BODY>
  47. </HTML>