资源描述:
《p-h-p技术生成静态页面的实现》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、php技术生成静态页面的实现(ImplementationofstaticpagegenerationbyPHPTechnology)php技术生成静态页面的实现(ImplementationofstaticpagegenerationbyPHPTechnology)One,PHPscriptanddynamicpage.PHPscriptisaserver-sidescriptingprogram,whichcanbemixedwithHTMLfilesbyembeddingandothermethods.Itcanalsobeusedinclass,functionencapsul
2、ationandotherformstodealwithuserrequestsintheformoftemplates.Inanyway,thebasicprincipleisthis.Therequestfromtheclientrequestsapage----->Webserverareintroducedtospecifythecorrespondingscriptprocessing----->scriptisloadedbytheserverserver----->specifiedPHPparserscriptanalyticalformHTMLlanguageform
3、---->parsingHTMLsentenceonthewaybacktothebrowser.Itisnotdifficulttosee,afterthepagesenttothebrowser,PHPdoesnotexist,hasbeentransformedintoHTMLstatement.Theclientrequestsadynamicfile,andinfactthereisnorealfile,wherethePHPcorrespondstothepage,andthensendsitbacktothebrowser.Thispageprocessingmethod
4、iscalled"dynamicpage"".Two,staticpage.StaticpagereferstotheserverreallyexistsonlycontainsHTMLandJS,CSSandotherclientsrunthescriptpage.It'sawayofdealingwithit.Therequestfromtheclientrequestsapage->WEBservertoconfirmandloadapage---->WEBserverwillpackagethepagetotransferbacktothebrowser.Fromthispro
5、cess,wecomparethedynamicpage,youcanpresent.ThedynamicpageisrequiredbytheWebserverPHPparserparsing,andoftenneedtoconnecttothedatabase,thedatabaseaccessoperation,andthentoformtheHTMLlanguageinformationpacket;andastaticpage,withoutanalysis,withoutconnectingtothedatabase,sentdirectly,whichcangreatly
6、reducetheserverpressure,improveserverloadcapacity,providingsignificantpageopenspeedandwebsitetheoverallspeedofopening.However,thedisadvantageisthattherequestcannotbeprocesseddynamically,andthefilemustexistontheserver.Three,templateandtemplateanalysis.ThetemplatehasnotfilledthecontentHTMLfileyet.
7、Forexample:Temp.htmlCode:Herearethequotes:
{Title}Thisisa{file}file''''stempletsPHPprocessing:Herearethequotes:Templetest.phpCode:$title="HPenthusiaststesttemplate";$file="TwoMaxIntert