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.

65 lines
1.8 KiB

  1. <%@ LANGUAGE = PerlScript%>
  2. <HTML>
  3. <HEAD>
  4. <!--
  5. Copyright (c) 1996, Microsoft Corporation. All rights reserved.
  6. Developed by ActiveState Internet Corp., http://www.ActiveState.com
  7. -->
  8. <TITLE>Active Server Pages - Perl Version</title>
  9. </HEAD>
  10. <BODY>
  11. <BODY BGCOLOR=#FFFFFF>
  12. <!--
  13. ActiveState PerlScript sample
  14. PerlScript: The coolest way to program custom web solutions.
  15. -->
  16. <!-- Masthead -->
  17. <TABLE CELLPADDING=3 BORDER=0 CELLSPACING=0>
  18. <TR VALIGN=TOP ><TD WIDTH=400>
  19. <A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="ActiveState PerlScript" BORDER=0></A><P>
  20. </TD></TR></TABLE>
  21. <HR>
  22. <H3>Active Server Session Object</H3>
  23. <br>
  24. This examples uses the ASP Session object. It retrieves a session variable,
  25. increments its value, and saves it each time the webpage is reloaded.
  26. <BR>
  27. <BR>
  28. <B>
  29. <%
  30. # get the value associated with 'MyVar'
  31. # increment the value then store it back
  32. $var = $Session->{'MyVar'};
  33. $var++;
  34. $Session->{'MyVar'} = $var;
  35. # let the user know what the value of the variable is
  36. $Response->write("The value of the session variable MyVar is $var after being incremented");
  37. %>
  38. </B>
  39. <br>
  40. <br>
  41. <a href="session2.asp">Click here to see another page access the session variable MyVar.</a>
  42. <!-- +++++++++++++++++++++++++++++++++++++
  43. here is the standard showsource link -
  44. Note that PerlScript must be the default language --> <hr>
  45. <%
  46. $url = $Request->ServerVariables('PATH_INFO')->item;
  47. $_ = $Request->ServerVariables('PATH_TRANSLATED')->item;
  48. s/[\/\\](\w*\.asp\Z)//m;
  49. $params = 'filename='."$1".'&URL='."$url";
  50. $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  51. %>
  52. <A HREF="index.htm"> Return </A>
  53. <A HREF="showsource.asp?<%=$params%>">
  54. <h4><i>view the source</i></h4></A>
  55. </BODY>
  56. </HTML>