PHP vs HTML
HyperText Markup Language, dav hu ua HTML yog cov lus cim rau cov nplooj ntawv web. HTML yog lub hauv paus tsim thaiv ntawm nplooj ntawv web. Web browser nyeem cov ntaub ntawv HTML thiab sau lawv mus rau hauv cov nplooj ntawv pom lossis pom tau. PHP (sawv rau PHP: Hypertext Preprocessor) yog ib hom lus server sab sau ntawv, tshwj xeeb tshaj yog tsim rau kev tsim cov nplooj ntawv dynamic thiab sib tham sib. PHP scripts tuaj yeem muab tso rau hauv cov ntaub ntawv HTML.
HTML yog dab tsi?
HTML, raws li tau hais dhau los yog hom lus cim, tsis yog hom lus programming. Ib hom lus markup yog ib txheej ntawm cov cim cim npe thiab HTML siv cov cim cim npe, uas feem ntau hu ua HTML tags, los piav qhia cov nplooj ntawv web. Cov ntaub ntawv HTML piav qhia cov nplooj ntawv web thiab lawv muaj cov cim HTML thiab cov ntawv dawb. HTML cim npe tuaj yeem txheeb xyuas tau yooj yim hauv daim ntawv HTML vim lawv nyob ib puag ncig los ntawm lub kaum sab xis (xws li). HTML tags feem ntau muab tso rau hauv ib daim ntawv ua khub, qhov twg thawj tag yog qhov pib tag (piv txwv li ) thiab daim ntawv thib ob yog qhov kawg tag (piv txwv li). Lub luag haujlwm ntawm lub vev xaib browser (xws li Internet Explorer, Firefox, thiab lwm yam) yog nyeem cov ntawv HTML thiab tso nws ua nplooj ntawv web. Lub browser siv cov HTML cim npe los txhais cov ntsiab lus ntawm nplooj ntawv thiab HTML cim npe lawv tus kheej tsis pom los ntawm browser. Cov nplooj ntawv HTML tuaj yeem kos duab, cov khoom thiab cov ntawv sau ua lus zoo li JavaScript. Ntxiv mus, HTML tuaj yeem siv los tsim cov ntawv sib tham.
PHP yog dab tsi?
Raws li tau hais ua ntej, PHP yog cov lus sau ntawv tshwj xeeb uas tsim nyog rau kev tsim cov nplooj ntawv web dynamic. PHP yog qhib qhov software thiab nws yog dawb mus download tau thiab siv. PHP scripts raug tua ntawm lub vev xaib server. PHP code hauv cov ntaub ntawv thov raug tua los ntawm PHP runtime thiab tsim cov nplooj ntawv web dynamic. PHP tuaj yeem siv tau rau hauv feem ntau lub vev xaib servers (Apache, IIS, thiab lwm yam) thiab khiav ntawm ntau lub platform xws li Windows, Linux, UNIX, thiab lwm yam. PHP kuj tuaj yeem siv nrog ntau Relational Database Management Systems (RDBMS). Txawm hais tias PHP yog Ameslikas tsim los tsim cov nplooj ntawv web dynamic, nws tam sim no tsom mus rau server-sab scripting qhov twg nws muab cov ntsiab lus dynamic los ntawm lub web server rau tus neeg siv khoom. PHP cov ntaub ntawv tuaj yeem muaj cov ntawv nyeem, HTML cim npe thiab cov ntawv sau. PHP cov ntaub ntawv tau ua tiav los ntawm lub vev xaib server thiab xa rov qab mus rau qhov browser li HTML dawb. PHP cov ntaub ntawv tuaj yeem txheeb xyuas nrog cov ntaub ntawv txuas ntxiv “.php”, “.php3”, lossis “.phtml”
Qhov txawv ntawm HTML thiab PHP
Qhov sib txawv tseem ceeb ntawm HTML thiab PHP yog HTML yog cov lus cim uas siv los qhia cov ntsiab lus ntawm nplooj ntawv web, thaum PHP yog hom lus sau. Cov nplooj ntawv web tsim siv tsuas yog HTML yog nplooj ntawv web zoo li qub thiab lawv yuav zoo ib yam txhua zaus lawv qhib. Tab sis PHP cov ntaub ntawv tuaj yeem tsim cov nplooj ntawv web dynamic uas cov ntsiab lus tuaj yeem hloov pauv qee lub sijhawm. Piv txwv li, dynamic nplooj ntawv web tsim nrog PHP tuaj yeem suav nrog cov khoom xws li hnub tim / lub sijhawm tam sim no, cov ntaub ntawv xa los ntawm tus neeg siv siv daim ntawv lossis cov ntaub ntawv los ntawm database.