当前位置: 首页 > 图文教程 > 网络编程 > 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   浏览: 38 ::
收藏到网摘: n/a

  Subscribe.asp
<%@ Language=JavaScript %>

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

<%
// output relevant meta tags
Init( "Subscription" );

// output common top of page
Header( '<a href="work.asp">Work</a> --> Subscription', 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 an email address, validate it first
      // so that if it fails we can show the form to fix
      var sEmail = "";
      var bSubmitted = (Request.Form.Count > 0);

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

         // validate the email address and moan if it fails
         if ( !IsValidEmail ( sEmail ) )
         {
            Out ( '<h5><font color="red">"' + sEmail + '" <i>appears</i> to be an invalid email address - please try again!</font></h5>' );
            Out ( '<p><font color="red">If you disagree, please <a href="Contact.asp">contact me</a> directly.</font><p>' );
            // pretend the form hasn'\t been sent yet
            bSubmitted = false;
         }
      }

      // show the form if not submitted yet
      if ( !bSubmitted )
      {
         Out ( 'If you\'re interested in hearing whenever a new article is posted, or an existing one is updated, type in your email address below and hit <b>Subscribe!</b>' );
         Out ( '<p>Whenever you want to stop receiving my emails, guess what? That\'s right, enter your email address and hit <b>Unsubscribe</b>...' );
         Out ( '<p><i>Your email address will never sold to or otherwise used by any third party, just me.</i>' );

         // here's the form tag. the action attribute is the name of
         // the file that will be called with the answer - in this case
    &n