国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
博客園 - liuxiaoyi666 - web下的投票系統(tǒng)設(shè)計

投票的選擇的不確定性常常使我們在設(shè)計數(shù)據(jù)庫的時候感到無從下手。所以我用的不是數(shù)據(jù)庫保存的投票選項而是用的xml。用xml的設(shè)計的好處有很多,其中包括我們可以在其中保留很多的屬性,在設(shè)計的時候,也可以進行多重選擇都是一個很好的辦法,用xsl對生成的xml文件進行解析這樣的設(shè)計模式感覺很爽

我的xml的sample是這樣的
<?xml version=‘1.0‘ encoding=‘gb2312‘ ?>
<?xml-stylesheet type=‘text/xsl‘ href=‘votesample.xsl‘?>
<root>
<Questionname><![CDATA[我們的網(wǎng)站好看么?]]></Questionname>
<Choose select=‘radio‘ votekindid=‘1‘>
  <ChooseItem value=‘a(chǎn)‘><![CDATA[好看]]></ChooseItem>
  <ChooseItem value=‘b‘><![CDATA[不好看]]></ChooseItem>
  <ChooseItem value=‘c‘><![CDATA[不知道]]></ChooseItem>
  <ChooseItem value=‘d‘><![CDATA[無所謂]]></ChooseItem>
</Choose>
</root>

xsl的sample:
<?xml version="1.0" encoding="gb2312" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xsl:output method="xml" indent="yes" encoding="GB2312" />
<xsl:template match="/">
  <div>
    <div><xsl:value-of select="http://root/Questionname" /></div>
    <table width="95%">
       <xsl:variable name="inputelement" select="
//root/Choose/@select" />
       <form action="vote/record.asp" target="observe" method="post">
       <input type="hidden" name="votekindid" value="{//root/Choose/@votekindid}" />
          <xsl:for-each select="http://root/Choose/ChooseItem">
      <tr>
         <td align="left"><input type="{$inputelement}" name="choise" value="{@value}"><xsl:if test="position()=1"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if></input><xsl:value-of select="@value" /></td><td align="left" width="80%"><xsl:value-of select="." /></td>
      </tr>  
   </xsl:for-each>
      <tr><td align="center"></td><td align="left"><img src="images/index_left_button3.gif" onclick="javascript:newWin(‘vote/result.asp?votekindid={//root/Choose/@votekindid}‘)" style="cursor:hand;" />  <input type="image" src="images/index_left_button4.gif" value="提交" onclick="javascript:newWin()" /></td></tr>
       </form>
    </table>
  </div>
  <script language="javascript">
  <![CDATA[
  function newWin(url){
  if(url==‘‘){
  newWindow=window.open("about:blank","observe","toolbar,resizable,scrollbars,dependent,width=500,height=420,left=150,top=80");
  newWindow.focus();}
  else{
  newWindow=window.open(url,"observe","toolbar,resizable,scrollbars,dependent,width=500,height=420,left=150,top=80");
  newWindow.focus();
  }
  }
  ]]>
  </script>
</xsl:template>
</xsl:stylesheet>

然后用一個vote表,記錄一下值
用一個sql語句 select votechoose,count(votechoose) from vote where voteid=值 group by votechoose 進行統(tǒng)計

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
XML查看對應(yīng)的 XSLT 樣式表
XML 論壇
XSLT轉(zhuǎn)換XML小結(jié)
制作SF左圖右介紹標(biāo)簽
如何在XML中使用nbsp
xml的DTD元素屬性的定義格式
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服