首页|操作系统|软件开发|网页制作|媒体动画|数据库|ASP教程|ASP.NET教程|PHP教程|JSP教程|XML教程|建站资料|软件学院|行业资讯|平面设计|网络安全|晒IT论坛|IT人才
  位置: 晒IT >> ASP教程 >> ASP实例教程 >> 正文
 
 
一个免费的邮件列表源程序(三)
一个免费的邮件列表源程序(三)
 
 

               Out ( 'Email:' );
            Out ( '</td><td align="left" valign="top">' );
               // a simple text box. we'll reference it with the name "name"
               // and show 22 characters on the form. use the maxlength
               // attribute to set the maximum characters they can enter.
               // use value="some text" to pre-fill the input with data.
               //
               // IMPORTANT! using names that are commonly used by
               // other web sites has a big advantage to the user - IE
               // will drop down a list of previous answers, which they
               // can usually pick from rather than type in. Think about this.
               Out ( '<input type="text" name="email" size="31" value="' + sEmail + '"></input>' );
            Out ( '</td></tr>' );

            Out ( '<tr><td align="right" valign="top">' );
               Out ( '&nbsp;' );
            Out ( '</td><td align="left" valign="top">' );
               // type='submit" provides a submit button to perform the
               // form action. the button says "Submit" unless you override
               // with the value attribute.
               Out ( '<input type="submit" name="action" value="Subscribe"></input>&nbsp;<input type="submit" name="action" value="Unsubscribe"></input>' );
            Out ( '</td></tr>' );

            Out ( '</table>' );
         Out ( '</form></center>' );
      }
      else
      {
         var sAction = "" + Request.Form ( "action" );

         if ( sAction == "Subscribe" )
            AddEmail ( sEmail ) ;
         else
            RemoveEmail ( sEmail );

         Out ( '<p>' );
      }

      Out ( 'Do you want to see how this form adds and removes addresses to my database? All the source code is just a click away!' );
      Out ( '<p><center><a href="ShowSource.asp? page=Subscribe"><img src="images/source.gif" border=0></a></center>' );
      Out ( '<p>In <a href="MailToList.asp">Part 2</a> see how I wrote a form to mail all my subscribers...' );

   Out ( '</td>' );
   Out ( '<td width="20%">&nbsp;</td>' );
}

// ============================================
// validate email address
// ============================================
function IsValidEmail ( sEmail )
{
   // regular expression courtesy of ed.courtenay@nationwideisp.net
   // I won't even pretend that I've read through this yet!
  • 上一篇: 用密码保护页面 (I)
  • 下一篇: 一个免费的邮件列表源程序(二)
  •  告诉好友  打印此文 关闭窗口 返回顶部
     
    热点文章
     
     
    推荐文章
     
     
    相关文章

    | 设为首页 | 加入收藏 | 联系我们 | 友情链接 | 诚聘英才 |
    Copyright© 2008 ShaiIT.Com .All Rights Reserved
    下载alexa工具,提升您的网站排名