home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 March / PCWorld_2003-03_cd.bin / Software / Topware / activeperl / ActivePerl / Perl / eg / aspSamples / response.asp < prev    next >
Encoding:
Text File  |  2000-08-10  |  1.4 KB  |  43 lines

  1. <%@ LANGUAGE = PerlScript%>
  2. <HTML>
  3. <HEAD><TITLE>Response Object</TITLE></HEAD>
  4. <!-- 
  5.     Copyright (c) 1996, Microsoft Corporation.  All rights reserved.
  6.     Developed by ActiveState Internet Corp., http://www.ActiveState.com
  7. -->
  8.  
  9. <BODY> <BODY BGCOLOR=#FFFFFF>
  10. <!-- 
  11.     ActiveState PerlScript sample 
  12.     PerlScript:  The coolest way to program custom web solutions. 
  13. -->
  14.  
  15. <!-- Masthead -->
  16. <TABLE CELLPADDING=3 BORDER=0 CELLSPACING=0>
  17. <TR VALIGN=TOP ><TD WIDTH=400>
  18. <A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="ActiveState PerlScript" BORDER=0></A><P>
  19. </TD></TR></TABLE>
  20.  
  21. <H3>Response Object</H3><P>
  22. There are many ways to get information sent to a browser.<P>
  23. <OL>
  24. <LI>You can use HTML!</LI>
  25. <LI>You can use <%="expressions" %>.</LI>
  26. <LI>You can use <% $Response->write("the Response object");%>.</LI>
  27. </OL>
  28. <!-- +++++++++++++++++++++++++++++++++++++
  29. here is the standard showsource link - 
  30.     Note that PerlScript must be the default language --><hr>
  31. <%
  32.     $url = $Request->ServerVariables('PATH_INFO')->item;
  33.     $_ = $Request->ServerVariables('PATH_TRANSLATED')->item;
  34.     s/[\/\\](\w*\.asp\Z)//m;
  35.     $params = 'filename='."$1".'&URL='."$url";
  36.     $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  37. %>
  38. <A HREF="index.htm"> Return </A>
  39. <A HREF="showsource.asp?<%=$params%>">
  40. <h4><i>view the source</i></h4></A>  
  41.  
  42. </BODY>
  43. </HTML>