home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 1997 / CT_SW_97.ISO / pc / software / entwickl / win95 / plsei306.exe / aspSamples / vbs-pl-param.asp < prev   
Text File  |  1997-03-22  |  2KB  |  60 lines

  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  4. <meta name="GENERATOR" content="ActiveWare_Hack = Dick Hardt">
  5. <!-- 
  6.     Copyright (c) 1996, Microsoft Corporation.  All rights reserved.
  7.     Developed by ActiveWare Internet Corp., http://www.ActiveWare.com
  8. -->
  9. <title>VBScript calling PerlScript - Hello, world!</title>
  10. </head>
  11.  
  12. <body>
  13. <BODY BGCOLOR=#FFFFFF>
  14. <!-- 
  15.     ActiveWare PerlScript sample 
  16.     PerlScript:  The coolest way to program custom web solutions. 
  17. -->
  18.  
  19. <!-- Masthead -->
  20. <TABLE CELLPADDING=3 BORDER=0 CELLSPACING=0>
  21. <TR VALIGN=TOP ><TD WIDTH=400>
  22. <A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="ActiveWare PerlScript" BORDER=0></A><P>
  23. </TD></TR></TABLE>
  24.  
  25.  
  26. <h2> VBScript calling PerlScript for string manipulation
  27. <hr>
  28.  
  29. <script language=PerlScript RUNAT=Server>
  30. sub foobar {
  31.      return reverse $_[0];
  32. }
  33. </script>
  34. <blockquote>
  35. <%
  36.     'VBScript is default script engine
  37.     response.write "VBScript says: Hello, World!<P>"
  38.     response.write foobar(">P<!dlroW ,olleH :syas tpircSlreP")
  39. %>
  40. </blockquote>
  41.  </h2>
  42. <!-- +++++++++++++++++++++++++++++++++++++
  43. here is the standard showsource link - in VBScript--> <hr>
  44.  
  45. <SCRIPT LANGUAGE="PerlScript" RUNAT="Server">
  46. sub GetParams
  47. {
  48.     $url = $Request->ServerVariables('PATH_INFO')->item;
  49.     $params = 'filename=vbs-pl-param.asp&URL='."$url";
  50.     $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  51.       $Response->write($params);
  52. }
  53. </SCRIPT>
  54. <A HREF="index.htm"> Return </A>
  55. <A HREF="showsource.asp?<% GetParams %>">
  56. <h4><i>view the source</i></h4></A>
  57.  
  58. </body>
  59. </html>
  60.