home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 1997 / CT_SW_97.ISO / pc / software / entwickl / win95 / plsei306.exe / aspSamples / adrot.asp < prev    next >
Text File  |  1997-03-22  |  1KB  |  45 lines

  1. <%@ LANGUAGE = PerlScript%>
  2. <HTML>
  3. <HEAD>
  4. <!-- 
  5.     Copyright (c) 1996, Microsoft Corporation.  All rights reserved.
  6.     Developed by ActiveWare Internet Corp., http://www.ActiveWare.com
  7. !-->
  8. <TITLE> Create a MSWC.AdRotator server Component</TITLE>
  9.  
  10. </HEAD>
  11. <BODY> <BODY BGCOLOR=#FFFFFF>
  12. <!-- 
  13.     ActiveWare PerlScript sample 
  14.     PerlScript:  The coolest way to program custom web solutions. 
  15. -->
  16.  
  17. <!-- Masthead -->
  18. <TABLE CELLPADDING=3 BORDER=0 CELLSPACING=0>
  19. <TR VALIGN=TOP ><TD WIDTH=400>
  20. <A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="ActiveWare PerlScript" BORDER=0></A><P>
  21. </TD></TR></TABLE>
  22.  
  23. <H2> Create a MSWC.AdRotator server Component that can be used to automate rotation of advertisements on a Web page. </H2>
  24.  
  25. <% 
  26.     $Ad = $Server->CreateObject('MSWC.Adrotator'); 
  27. %>
  28.  
  29. <%= $Ad->GetAdvertisement("/AdvWorks/adrot.txt") %>
  30. <!-- +++++++++++++++++++++++++++++++++++++
  31. here is the standard showsource link - 
  32.     Note that PerlScript must be the default language --> <hr>
  33. <%
  34.     $url = $Request->ServerVariables('PATH_INFO')->item;
  35.     $_ = $Request->ServerVariables('PATH_TRANSLATED')->item;
  36.     s/[\/\\](\w*\.asp\Z)//m;
  37.     $params = 'filename='."$1".'&URL='."$url";
  38.     $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  39. %>
  40. <A HREF="index.htm"> Return </A>
  41. <A HREF="showsource.asp?<%=$params%>">
  42. <h4><i>view the source</i></h4></A>  
  43.  
  44. </BODY>
  45. <HTML>