首页 | 源码下载 | 网站模板 | 网页特效 | 广告代码 | 网页素材 | 字体下载 | 书库 | 站长工具
会员投稿 投稿指南 RSS订阅
当前位置:主页>网络编程>PHP教程>资讯:php 在线问卷调查程序

php 在线问卷调查程序

www.jz123.cn  2008-09-11   来源:   中国建站    编辑整理    我要投递新闻

 

也是昨天用到了一个php 在线问卷调查程序哦,客户要在新浪投放广告,所以要统计用户相关信息,好了我们先看看效果页面

<html>
<head>
<title>问卷调查</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
 background-color: #330104;
 text-align: center;
 background-image: url(images/bg.jpg);
 background-repeat: repeat-x;
 color: #fee0a8;
 margin: 0px;
 padding: 0px;
}
* {
 margin: 0px;
 padding: 0px;
}
#poll {
 width: 650px;
 margin-left: 100px;
}
#poll h1 {
 font-size: 12px;
 font-weight: normal;
 padding-top: 30px;
 line-height: 22px;
 height: 22px;
}
table.pollt {
 line-height: 24px;
 height: 24px;
 margin-top: 22px;
}
input.inputt {
 border: 1px solid #FEE0A8;
 background-color: #FFF9EC;
}
input.btn {
 background-image: url(images/btn.gif);
 display: block;
 height: 32px;
 width: 97px;
 color: #FEE0A8;
 border-top-width: 0px;
 border-right-width: 0px;
 border-bottom-width: 0px;
 border-left-width: 0px;
 border-top-style: none;
 border-right-style: none;
 border-bottom-style: none;
 border-left-style: none;
 background-color: #240002;
}
-->
</style>
<script>
<!--

function check() {
   var flag1=0;
  var flag2=0;
  var flag3=0;
  var flag4=0;
  var flag5=0;
  var flag6=0;
  var radio1=document.getElementsByName("v1");
   for(var i=0;i<radio1.length;i++)
   {
         if(radio1.item(i).checked==true)
             {
     flag1=1;
                  break;

       }
   }
   var radio2=document.getElementsByName("v2");
   for(var i=0;i<radio2.length;i++)
   {
         if(radio2.item(i).checked==true)
             {
     flag2=1;
                  break;
       }
   }
   var radio3=document.getElementsByName("v3");
   for(var i=0;i<radio3.length;i++)
   {
         if(radio3.item(i).checked==true)
             {
     flag3=1;
                  break;
       }
   }
   var radio4=document.getElementsByName("v4");
   for(var i=0;i<radio4.length;i++)
   {
         if(radio4.item(i).checked==true)
             {
     flag4=1;
                  break;
       }
   }
   var radio5=document.getElementsByName("v5");
   for(var i=0;i<radio5.length;i++)
   {
         if(radio5.item(i).checked==true)
             {
     flag5=1;
                  break;
       }
   }
   var radio6=document.getElementsByName("v6");
   for(var i=0;i<radio6.length;i++)
   {
         if(radio6.item(i).checked==true)
             {
     flag6=1;
                  break;
       }
   }

     if(!flag1||!flag2||!flag3||!flag4||!flag5||!flag6){
              alert("对不起,请回答完其他的问题?");
              return false;
     }
  
 if (add.name.value=="") {
     alert("请输入用户名!");
  add.name.focus();    
  return false;
 }
 if (add.name.value.length<2 || add.name.value.length>14)  {
  alert("姓名应该在2-14个字符之间!");
  add.name.focus();
  return false;
 } 
  if (add.tel.value==""){
    alert("请输入电话或手机号码!");
  add.tel.focus();    
  return false;
 } 
 if (add.email.value==""){
    alert("请输入电子邮件地址!");
  add.email.focus();    
  return false;
 } 
 var filter=/^s*([A-Za-z0-9_-]+(.w+)*@(w+.)+w{2,3})s*$/;
    if (!filter.test(document.add.email.value)) {
     alert("邮件地址不正确,请重新填写!");
        document.add.email.focus();
        document.add.email.select();
        return (false);
    } 
 if (add.address.value == ""){
  alert("请输入你的联系方式")
  add.email.focus();
  return false;
 }
 

}

//-->
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (问卷调查.psd) -->
<table id="__01" width="1002" height="1100" border="0" cellpadding="0" cellspacing="0">
 <tr>
  <td colspan="2">
   <img src="images/index_01.jpg" width="1002" height="57" alt=""></td>
 </tr>
 <tr>
  <td colspan="2">
   <img src="images/index_02.jpg" width="1002" height="107" alt=""></td>
 </tr>
 <tr>
  <td height="811" colspan="2" valign="top" background="images/index_03.jpg">
     <div id="poll">
     <form action="post.php" method="post"  name="add" enctype="multipart/form-data" onSubmit="return check();" >
<h1>1、泸州老窖特曲有多少年的历史?</h1>
<input name="v1" type="radio" value="300年">300年            
<input name="v1" type="radio" value="400年">400年              
<input name="v1" type="radio" value="1000年">1000年

<h1>2、浓香型白酒又被称为什么香型?</h1>
<input name="v2" type="radio" value="酱香型">酱香型          
<input name="v2" type="radio" value="奇香型">奇香型             
<input name="v2" type="radio" value="泸型">泸型

<h1>3、泸州老窖特曲曾代表中国获得最早什么国际大奖?</h1>
<input name="v3" type="radio" value="巴拿马万国博览会金奖">巴拿马万国博览会金奖
<input name="v3" type="radio" value="巴西博览会金奖">巴西博览会金奖        
<input name="v3" type="radio" value="巴拿马糖烟酒会金奖">巴拿马糖烟酒会金奖

<h1>4、泸州老窖特曲曾获得什么称号?</h1>
<input name="v4" type="radio" value="物质文化遗产">物质文化遗产     
<input name="v4" type="radio" value="非物质文化遗产">非物质文化遗产

<h1>5、此次泸州老窖特曲推出的赠品名称为?</h1>
<input name="v5" type="radio" value="金奖珍藏">金奖珍藏       
<input name="v5" type="radio" value="传世浓香">传世浓香         
<input name="v5" type="radio" value="传世珍藏">传世珍藏

<h1>6、在此次泸州老窖特曲促销活动中,您买多少瓶特曲就能获得“传世珍藏”大礼?</h1>
<input name="v6" type="radio" value="2瓶">2瓶              
<input name="v6" type="radio" value="4瓶">4瓶                  
<input name="v6" type="radio" value="6瓶">6瓶
     <table class="pollt" width="489" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="108">您的姓名</td>
    <td width="381"><label>
      <input type="text" class="inputt" name="name" id="name">
    </label></td>
  </tr>
  <tr>
    <td>您的电话</td>
    <td><input type="text" class="inputt" name="tel" id="tel"></td>
  </tr>
  <tr>
    <td>您的E-mail</td>
    <td><input type="text" class="inputt" name="email" id="email"></td>
  </tr>
  <tr>
    <td>您的联系方式</td>
    <td><input name="address" type="text" class="inputt" id="address" size="50"></td>
  </tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="20">
  <tr>
    <td align="center"><input name="" type="submit" class="btn" value="提交"></td>
    <td align="center"><input name="重置" type="reset" class="btn" value="重新作答"></td>
  </tr>
</table>
</form>


          </div>
        </td>
  </tr>
 <tr>
  <td>
   <img src="images/index_04.jpg" width="17" height="125" alt=""></td>
  <td>
   <img src="images/index_05.jpg" width="985" height="125" alt=""></td>
 </tr>
</table>

<!-- End ImageReady Slices -->
</body>
</html>

上一篇:PHP加密文本文件并限制特定页面的存取 下一篇:PHP防止外部post提交

评论总数:1 [ 查看全部 ] 网友评论


关于我们隐私版权广告服务友情链接联系我们网站地图