西安邮电大学毕业设计(外文翻译)题目:DesignandImplementationoftheWebsiteBasedonPHP&MYSQL基于PHP和MYSQL的网站设计和实现学院:计算机学院专业:网络工程班级:网络1101学生姓名:周从军导师姓名:朱辉职称:讲师AbstractPHPandMYSQLhasbeenthemainwebdevelopmenttoolforitisfreeandopensource.TheauthorshavediscussedtheenvironmentalissuesindevelopmentprocessbasedonPHPandMYSQLandtheimplementationprocessofthewebsite.KeywordsPHP;MYSQL;DevelopmentandImplementation.1.INTRODUCTIONWiththedevelopmentofWebtechnology,itisinevitablechoiceforallkindofcorporategrowthtocombinetraditionalmarketingwithnetworkmarketing.Theeffectivemethodofnetworkmarketingistoestablishthewebsitewhichissuitablefortheircompany.Atpresentthewebsitedevelopment'smainstreamplatformincludes:LAMP(Linuxoperatingsystem,Apachenetworkserver,MYSQLdatabase,PHPprogramminglanguage),J2EEand.Netcommercialsoftware.BecausePHPandMYSQLisfree,opensourceandsoon,theyarenotedforITprofessionals.Fromtheperspectiveofwebsitetraffic,morethan70%ofwebsitetrafficisprovidedwithLAMP,whichismostpopularplatformfordevelopingthewebsite.Inthispaper,wedesignedawebsitebasedonPHPandMYSQL.Thepaperisorganizedasfollows.Section1makeconclusionInSection5.2.DEVELOPMENTENVIRONMENTANALYSISA.TheChoiceofDevelopmentLanguageASP.NET,PHP&JSParethreemainstreamlanguagesofthewebsitedevelopment,whichhavetheiradvantagesanddisadvantagesrespectively,thecomparisonbetweenthemisshowninTable1.TheprojecttakesPHPasthedevelopmentlanguage,thereasonisasfollows:•Free.Theprojectissmall,whichisnoneedtousethepaymentdevelopmentplatformsuchasASP.NETandJSP.•Strongsupporting.Middleandsmallscalewebsites,evensomelarge-scalewebsitessuchasbaidu,SinainChinatakePHPasthedevelopmentlanguage,whichcancontributetosolvetheproblemduringtheprogramming.analyzesdevelopmentenvironment.InSection2,weproposedthedevelopmentmodelbasedonPHP.ThencasestudyinSection4.we•Goodportability.AlthoughitisdesignedtouseintheenvironmentofLinuxandApacheWebserversystematfirst,nowPHPisalreadytransplantedanyoperatingsystemandcompatiblestandardWebserversoftware.•Simplegrammar.PHPhasmanysimilaritieswiththeCprogramminglanguage,soitiseasytoprogramusingPHPfortheCprogrammers.•Rapiddevelopment.Becausethesourcecodeisopen,PHPwillcontinuetodeveloprapidly.WhenZeevSuraskiaddedtheobject-orientedsyntaxbackinthedaysofPHP3,itwasaddedassyntacticsugarforaccessingcollections.TheOOmodelalsohadsupportforinheritanceandallowedaclass(andobject)toaggregatebothmethodsandproperties,butnotmuchmore.WhenZeevandAndiGutmansrewrotethescriptingengineforPHP4,itwasacompletelynewengine;itranmuchfaster,wasmorestable,andboastedmorefeatures.However,theOOmodelfirstintroducedinPHP3wasbarelytouched.Althoughtheobjectmodelhadseriouslimitations,itwasusedextensivelyaroundtheworld,ofteninlargePHPapplications.ThisimpressiveuseoftheOOPparadigmwithPHP4,despiteitsweaknesses,ledtoitbeingthemainfocusforthePHP5release.So,whatweresomeofthelimitationsinPHP3and4?Thebiggestlimitation(whichledtofurtherlimitations)wasthefactthatthecopysemanticsofobjectswerethesameasfornativetypes.So,howdidthisactuallyaffectthePHPdeveloper?Whenassigningavariable(thatpointstoanobject)toanothervariable,acopyoftheobjectwouldbecreated.Notonlydidthisimpactperformance,butitalsousuallyledtoobscurebehaviorandbugsinPHP4applicationsbecausemanydevelopersthoughtthatbothvariableswouldpointatthesameobject,whichwasnotthecase.Thevariableswereinsteadpointingatseparatecopiesofthesameobject.Changingonewouldnotchangetheother.Forexample:classPerson{var$name;functiongetName(){return$this-name;}functionsetName($name){$this-name=$name;}functionPerson($name){$this-setName($name);}}functionchangeName($person,$name){$person-setName($name);}$person=newPerson(Andi);changeName($person,Stig);print$person-getName();InPHP4,thiscodewouldprintoutAndi.Thereasonisthatwepasstheobject$persontothechangeName()functionby-value,andthus,$personiscopiedandchangeName()worksonacopyof$person.Thisbehaviorisnotintuitive,asmanydeveloperswouldexpecttheJava-likebehavior.InJava,variablesactuallyholdahandle(orpointer)totheobject,andtherefore,whenitiscopied,onlythehandle(andnottheentireobject)isduplicated.ThereweretwokindsofusersinPHP4:theoneswhowereawareofthisproblemandtheoneswhowerenot.Thelatterwouldusuallynotnoticethisproblemandtheircodewaswritteninawaywhereitdidnotreallymatteriftheproblemexisted.Surelysomeofthesepeoplehadsleeplessnightstryingtotrackdownweirdbugsthattheycouldnotpinpoint.Theformergroupdealtwiththisproblembyalwayspassingandassigningobjectsbyreference.Thiswouldpreventtheenginefromcopyingtheirobjects,butitwouldbeaheadachebecausethecodeincludednumerous&signs.Theoldobjectmodelnotonlyledtotheafore-mentionedproblems,butalsotofundamentalproblemsthatpreventedimplementingsomeadditionalfeaturewaywhereitdidnotreallymatteriftheproblemexisted.Surelysomeofthesepeoplehadsleeplessnightstryingtotrackdownweirdbugsthattheycouldnotpinpoint.Theformergroupdealtwiththisproblembyalwayspassingandassigningobjectsbyreference.Thiswouldpreventtheenginefromcopyingtheirobjects,butitwouldbeaheadachebecausethecodeincludednumerous&signs.Theoldobjectmodelnotonlyledtotheafore-mentionedproblem