资源描述:
《动态web文档毕业论文外文翻译》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、外文翻译DynamicWebDocumentsSofar,themodelwehaveusedisthatofFig.6-6:theclientsendsafilenametotheserver,whichthenreturnsthefile.IntheearlydaysoftheWeb,allcontentwas,infact,staticlikethis(justfiles)-However,inrecentyears,moreandmorecontenthasbecomedynamic,thatis,generatedondema
2、nd,ratherthanstoredondisk.Contentgenerationcantakeplaceeitherontheserversideorontheclientside.Letusnowexamineeachofthesecasesinturn.Server-SideDynamicWebPageGenerationToseewhyserver-sidecontentgenerationisneeded,considertheuseofforms,asdescribedearlier.Whenauserfillsinaf
3、ormandclicksonthesubmitbutton,amessageissenttotheserverindicatingthatitcontainsthecontentsofaform,alongwiththefieldstheuserfilledin.Thismessageisnotthenameofafiletoreturn.Whatisneededisthatthemessageisgiventoaprogramorscripttoprocess.Usually,theprocessinginvolvesusingthe
4、user-suppliedinformationtolookuparecordinadatabaseontheserver'sdiskandgenerateacustomHTMLpagetosendbacktotheclient.Forexample,inane-commerceapplication,aftertheuserclicksonPROCEEDTOCHECKOUT,thebrowserreturnsthecookiecontainingthecontentsoftheshoppingcart,butsomeprogramor
5、scriptontheserverhastobeinvokedtoprocessthecookieandgenerateanHTMLpageinresponse.TheHTMLpagemightdisplayaformcontainingthelistofitemsinthecartandtheuser'slast-knownshippingaddressalongwitharequesttoverifytheinformationandtospecifythemethodofpayment.Thestepsrequiredtoproc
6、esstheinformationfromanHTMLformareillustratedinFig.7・33.Figure7・33.StepsinprocessingtheinformationfromanHTMLform>1.User(illsinformDataCGIbaseBrowjwServerserin!ondisk2.Formsentback3.HandedtoCGI4.CGIqueriesDB5.Rocordfound6.CGIbuildspage7.Pagereturned8.PagedisplayedThetradi
7、tionalwaytohandleformsandotherinteractiveWebpagesisasystemcalledtheCGI(CommonGatewayInterface).ItisastandardizedinterfacetoallowWebserverstotalktoback-endprogramsandscriptsthatcanacceptinput(e.g.,fromforms)andgenerateHTMLpagesinresponse.Usually,theseback-endsarescriptswr
8、itteninthePerlscriptinglanguagebecausePerlscriptsareeasierandfastertowritethanprograms(atleast,ifyoukno