下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
Project2OnlineVotingSystem
SchoolofSoftware,ChengduPolytechnicLecturer:MuQichunTask11IPRestrictionsProgrammingWehavealreadyhadthreedifferentvotingrestrictionsbefore,andthenwewillhavealesscommonvotingrestriction,whichisIPrestriction.
Thereasonwhythisrestrictionisalesscommon
isthattherewillbesomeproblemswithrestrictingbyIP.
Forexample,schoolsorgovernmentagencies
oftenonlyhaveoneorasmallnumberofpublicIPaddressestotheoutside.IfIPvotingisrestricted,peopleinthisschool(governmentagency)canonlycastthespecifiednumberofvotes.
Thissituationisunlikelytobeacceptedinanactualvotingenvironment.
Thereasonwhywewanttousethisrestrictionhereisjustto
explainhowtorestrictvotingbyIPaddress
fromprogramming.Wepreviouslyrequiredonepersontovoteforupto3vehiclesaday.So
wecansetherethatthesameIPcancastupto15votesfor3vehicles
aday,whichmeans
thateachvehiclehas5votes.When
recordingthedetailsinthevotedetailtable,wesavetheIPaddressofeachvote.SowecanquerythevotingrecordsofthecurrentIPaddresstocheckifitexceeds15.Ifthenumberofrecordsexceeds15,youcannotvote,otherwiseyoucancontinuetovote.Thefollowingisthecodeofvotingrestriction4(note:thetypeofvoteTimefieldinthedatatablecorrespondingtothecurrentcodeisdatetime,ifitisothertypes,pleaserefertothepreviouscontenttomakemodifications):ProgrammingWecanseethatwhenjudgingwhetheritisthesameday,
CURRENT_DATE()
functioninMySQLisusedhere.Whenjudgingthesamedayearlier,weuseddatefunctioninPHP.WehavelearntmultipledateandtimerelatedfunctionsinMySQLsofar.YoucanrefertoBaidutounderstandtherelatedfunctionsinthisregard.SummaryInthiscourse,wehaveaddedalimittovoting,thatis,anIPaddresscancastamaximumof15votesaday.
Themethod
whichisverysimpleistoquerythecurrentnumberofvotesthattheIPhasvotedonthatday.Ifthenumberofrecordsisgreaterthan15,youc
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 宿舍安全用電保證書11篇
- 纖維纏繞壓力容器超高速撞擊損傷特性研究
- 二零二五年度勞動合同試用期標準協(xié)議范本8篇
- 二零二五版土方運輸服務(wù)合同:園林景觀工程材料運輸協(xié)議3篇
- 二零二五年度個人房產(chǎn)租賃合同模板
- 二零二五版工業(yè)自動化新品進場合作協(xié)議3篇
- 二零二五年度城市景觀美化宣傳品制作合同3篇
- 應(yīng)急指揮系統(tǒng)的建設(shè)與優(yōu)化
- 電氣行業(yè)安全管理工作總結(jié)
- 二零二五年度花卉進出口貿(mào)易合同協(xié)議3篇
- 物業(yè)管理裝修管理規(guī)定(5篇)
- (新版)工業(yè)機器人系統(tǒng)操作員(三級)職業(yè)鑒定理論考試題庫(含答案)
- 教育環(huán)境分析報告
- 人力資源服務(wù)公司章程
- (正式版)CB∕T 4552-2024 船舶行業(yè)企業(yè)安全生產(chǎn)文件編制和管理規(guī)定
- 2024年西藏中考物理模擬試題及參考答案
- 九型人格與領(lǐng)導(dǎo)力講義
- 人教版五年級上冊數(shù)學(xué)脫式計算練習(xí)200題及答案
- 卵巢黃體囊腫破裂教學(xué)查房
- 醫(yī)院定崗定編
- 2023年大學(xué)物理化學(xué)實驗報告化學(xué)電池溫度系數(shù)的測定
評論
0/150
提交評論