资源描述:
《tutorial using flash, php and mysql, keep persistent information》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Tutorial:UsingFlash,phpandMySql,keeppersistentinformation;FlashradioandpushbuttoncomponentsAtypicalFlashapplication,likeasimpleHTMLwebpage,doesnotcollectandstoredataontheservercomputer.Tostoreinformation,youneedtouseafileoradatabaseandconnecttothefileordatabaseusingso-calledserver-sideormiddlewa
2、resoftware.Similarly,atypicalphpapplicationacceptsformdatafromaHTMLformandproducesanHTMLdocument.ThisexampledemonstratesusingFlashandphptostoredatainandextractdatafromaMySqldatabase.BothphpandMySqlareconsideredOpenSourcetools.Theapplicationkeepstrackofvotescastfor4choices.Itisintendedtorepresent
3、apollingapplication,notavotingapplication.Pleasenotethatarealvotingapplicationwouldneedtoincorporatefeaturestoallowonlylegitimatevoterstovoteandtoonlyvoteonce.Adebateisgoingonnowconcerningvarioussystemsforelectronicvoting.Onefeatureconsideredcriticalbymany,thoughnotall,isthatthesystemproduceapap
4、ertrailforeachvote.Thistoyapplicationdoesnotincludeanyofthesefeatures.TheintentistodemonstratehowFlashcanconnecttoaphpscript.Beforecontinuing,onemorewarning:AbasiccontractwithanInternetServiceProvidergenerallywouldnotincludesupportofphpscriptsorMySql(oranyother)database.Thisapplicationandtutoria
5、lassumesphpandMySqlsupportand,moreover,assumesthatatablehasbeencreatedandinitializedtoholdthepollingdata.ItisassumedthatthereaderhassomebackgroundusingFlash.Thisdocumentwillexplainthefeaturesoftheapplication,notgivestep-by-stepinstructionsonhowtoreplicateit.TheinitialscreenfortheFlashinterfaceis
6、thefollowing:IfthepersonrespondsbyclickingontheradiobuttonnexttoOtherandthenSubmitvote,thefollowingscreenresults(atthispointforthisapplication.Idonotknowwherethese'votes'camefrom—perhapsmystudents).TheFlashinterfaceconsistsof·thestatictextfieldwiththewords"Ifyouhadtovotetoday,wouldyouvotefor…."·
7、4radiobuttoncomponents·1pushbuttoncomponent·Adynamictextfield,markedasacceptingHTMLtagsandwithaboundaryTherearetwolayers:onelayer,namedboard,holdsallthegraphics;theotherlayer,calledactions,holdstheActionScript.Thisisnotneces