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

ASP
ASP中数据库调用中常见错误的现象和解决方法
ASP取出HTML里面的图片地址的函数
关于分页查询和性能问题
利用Asp生成整站静态
用ASP+XMLHTTP编写一个天气预报程序
轻松检测浏览器是否接受Cookies信息
净化网络环境:ASP程序实现过滤脏话
入门:防范SQL注入攻击的新办法
如何对ASP.NET进行性能优化
ASP无法更新ACCESS数据库解决方法
ASP:利用ASP把图片上传到数据库
ASP:用ASP编程实现网络内容快速查找
ASP:用ASP打造一个小型的网页BBS系统
ASP:用Asp编程实现QQ的在线情况查询
通过表单创建word的一个例子
在ASP中轻松实现记录集分页显示
ASP中实现小偷程序的原理和简单示例
ASP:6行代码实现无组件上传
实用篇:用asp实现QQ在线查询
如何轻松打造ASP计数器

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 22 ::
收藏到网摘: 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