当前位置: 首页 > 图文教程 > 网络编程 > ASP > 一个免费的邮件列表源程序(一)

ASP
使用FSO自动创建多级文件夹的函数
专家教你利用思易ASP木马追捕入侵站点
技巧:用 isapi rewrite 实现asp的HTML静态化
使用ASP建设私人的搜索引擎
巧用SQL-DMO创建备份及校验的ASP应用
技巧:用GetString来提高ASP的速度
ASP实现的日历代码实例程序
WEB应用的缓存兼容性设计
用网站地图帮助搜索引擎
IIS虚拟主机网站防木马权限设置安全配置整理
ASP把长的数字用逗号隔开显示
所谓新云XSS跨站漏洞全公布
ASP技巧:禁用页面缓存的五种方法
ASP中实现从dbf数据库导出数据到sql表
简单熟悉掌握ASP的语法和变量
让弹出窗口变得“听话”一些
运用ASP调用数据库中视图及存储过程
瞄准Apache IIS7向开源张开双臂
ASP实现IE地址栏参数的判断
如何让你的ASP运行于非Windows平台

ASP 中的 一个免费的邮件列表源程序(一)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 32 ::
收藏到网摘: n/a

  MailToList.asp
<%@ Language=JavaScript %>

<!--#include file = "include/SetGlobals.asp"-->
<!--#include file = "include/DBPath.asp"-->

<%
// output relevant meta tags
Init( "Mail to list" );

// output common top of page
Header( '<a href="work.asp">Work</a> --> Mail to list', 3 );

// output page content
Content ( );

// output common bottom of page
Footer( );
%>

<% /* standard page elements */ %>
<!--#include file = "utils/Init.asp"-->
<!--#include file = "utils/Database.asp"-->
<!--#include file = "utils/Header.asp"-->
<!--#include file = "utils/Footer.asp"-->

<%
// ============================================
// the content of this page
// ============================================
function Content ( )
{
   Out ( '<td width="20%">&nbsp;</td>' );
   Out ( '<td width="60%">' );
    
      // if the form has a password, validate it first
      // so that if it fails we can show the form again
      var bSubmitted = (Request.Form.Count > 0);

      // has the form been submitted?
      if ( bSubmitted )
      {
         // get the password from the form...
          sPassword = "" + Request.Form ( "password" );

         // validate the password and moan if it fails
         if ( sPassword != sDBPath )
         {
            Out ( '<h3><font color="red">Invalid password!</font></h3>' );
            // pretend the form hasn'\t been sent yet
            bSubmitted = false;
         }
      }

      // show the form if not submitted yet
      if ( !bSubmitted )
      {
         Out ( 'In <a href="Subscribe.asp">Part 1</a> I showed you how I allowed you to subscribe to my mailing list. Here\'s where I can post an email to members of that mailing list.' );
         Out ( '<p>Strangely, I\'m not going to let you do it, but you <i>can</i> get the source code from the bottom of the page, and learn how I did it.' );
         // here's the form tag. the action attribute is the name of
         // the file that will be called with the answer - in this case
         // it's the same page. the method can be "post" to send the
         // form data 'behind the scenes' or "get" to appending the
         // data to the URL in the style page.asp?data1=a&data2=b
         //
         // use post most of the time - it's neater and "get" is limited