原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://1572091hyl10.blog.51cto.com/1562091/601842

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 transitional//EN "

 

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html>

 

<head>

 

<meta http-equiv="Content-Type" content="text/html; charset=GB2312">

 

<title>客户个性化信息提交</title>

 

</head>

 

<body>

 

<%

 

    '获取提交的表单信息       $bgcolor=Request.Form("bgcolor")

 

    $fgcolor=Request.Form("fgcolor")

 

    $pwd=Requesr.form("pwd">

 

    '如果提交的客户信息不为空,则将其存储到Cookie集合check中

 

    If bgcolor<>""or fgcolor<>""Then

 

         Response.Cookies("check")("bgcolor")=$bgcolor

 

         Response.Cookies("check")("fgcolor")=$fgcolor

 

         Response.Cookies("check")("pwd")=$pwd

 

         Response.Cookies("check").Expires=#2010-5-6#

 

    End If

 

    '读取 Cookie

 

    $bgcolor=Request.Cookies("check")("$bgcolor")       $fgcolor=Request.Cookies("check")("$fgcolor")

 

    $pwd=Request.cookies("check")("$pwd")

 

    '如果Cookie在用户的计算机上不存在,就创建一个表单,询问相关信息       If $bgcolor ="" and $fgcolor ="" and $pwd=""Then

 

%&gt;

 

    <h2 align="center">客户个性信息提交</h2>

 

    <Form action="checkcookies.asp" method="POST">

 

      <table border="1" cellspacing="0" align="center">

 

                  <tr>

 

                     <td>背景色:</td>

 

                     <td><input type="text" name="bgcolor"></td>

 

                  </tr>

 

                  <tr>

 

                     <td>背景色:</td>

 

                     <td><input type="text" name="fgcolor"></td>

 

                  </tr>

 

                  <tr>

 

                     <td>密码:</td>

 

                     <td><input type="password" name="pwd"></td>

 

                  </tr>

 

                  <tr>

 

                     <td colspan="2" align="center"><input name="submit" type="submit" value="提交">

 

    </td>

 

 

                  </tr>

 

               </table>       </Form>

 

    <%

 

        End If

 

        '如果Cookie已经存在,并且bgcolor存在,就跳转到color.asp           If bgcolor&lt;>""Then

 

                Response.Redirect "color.asp"

 

        End If

 

    %&gt;

 

    </body>

 

    </html>

 

以下图是应用在线软件“Dreamweaver 8 ”应用工具测试“客户个性化信息提交表单”测试结果,(540*452)像素

技巧打开网页进行客户个性化信息提交(代码编写)  

以下是IE6浏览器测试结果(540*452像素) 

技巧打开网页进行客户个性化信息提交(代码编写)