Yuav Ua Li Cas Sau Tsab Ntawv Rau Ib Nplooj Ntawv

Cov txheej txheem:

Yuav Ua Li Cas Sau Tsab Ntawv Rau Ib Nplooj Ntawv
Yuav Ua Li Cas Sau Tsab Ntawv Rau Ib Nplooj Ntawv

Video: Yuav Ua Li Cas Sau Tsab Ntawv Rau Ib Nplooj Ntawv

Video: Yuav Ua Li Cas Sau Tsab Ntawv Rau Ib Nplooj Ntawv
Video: sau tsab ntawv no rau tus kuv hlub 2024, Kaum ib hlis
Anonim

Feem ntau cov ntawv, tsab ntawv koj yuav tsum tau ntxig rau hauv nplooj ntawv yog sau ua PHP lossis JavaScript - cov no yog ob qho lus siv cov lus sau ua ke tshaj niaj hnub no. Lawv tsis muab tso rau hauv tib txoj kev, los saib ob txoj hauv kev.

Yuav ua li cas sau tsab ntawv rau ib nplooj ntawv
Yuav ua li cas sau tsab ntawv rau ib nplooj ntawv

Cov Lus Qhia

Kauj ruam 1

JavaScript ntawv sau yog cov ntawv uas tsis tau tua ntawm lub server, tab sis ncaj qha rau hauv browser, uas yog vim li cas lawv tau hu ua "client-side". Yog hais tias tsab ntawv tuaj rau koj raws li nyias muaj nyias cov ntawv nrog "js" txuas ntxiv, tom qab ntawd koj yuav tsum txuas nws rau nplooj ntawv los ntawm kev ntxiv cov kab lus sib txuas nrog qhov txuas mus rau cov ntawv no rau lub taub hau ntu ntawm nws cov HTML code. Lub header yog ib feem uas pib nrog tus pib thiab xaus nrog tus xaus. Yog li, koj tsis tuaj yeem mus yuam kev yog tias koj pom txoj cai kaw hauv nplooj ntawv nplooj ntawv thiab muab cov ntawv txuas hauv qab no rau sab nraud JavaScript ntawv nyob hauv pem hauv ntej ntawm nws: Ntawm no, src attribute qhia cov ntaub ntawv npe "script.js" - koj xav tau los hloov nws nrog lub npe koj js ntawv. Txhawm rau qhov browser nrhiav thiab nyeem cov ntawv no, nws yuav tsum tau muab tso rau hauv tib lub npe neeg rau zaub mov qhov twg nplooj nws tus kheej nyob. Yog tias koj upload nws mus rau lwm qhov chaw, sau qhov chaw nyob ua ke nrog rau cov ntaub ntawv npe hauv src attribute. Yog koj muaj JavaScript tsis nyob hauv lwm daim ntawv, tab sis tsuas yog cov ntawv pib nrog tus pib

Kauj ruam 2

PHP scripts raug tua ntawm lub server sab thiab raug hu ua, ntsig txog, "server". Thiab ntawm no, ib yam nkaus, yog tsab ntawv tuaj rau koj raws li nyias muaj nyias cov ntawv, ces koj yuav tsum ntxiv ib qhov txuas rau nws hauv nplooj ntawv. Hauv PHP, cov ntawv sib txuas yuav zoo li no: Ntawm no yog lub npe script.php - koj yuav tsum tau hloov nws nrog lub npe ntawm cov ntawv uas koj muaj. Koj yuav tsum sau tus lej cim no thaum pib ntawm nplooj ntawv, ua ntej txhua daim cim npe nyob hauv. Nws tseem ceeb kom paub tseeb tias tsis muaj kab nruab nrab lossis kab nruab nrab nyob sab php code. Yog hais tias nplooj ntawv rau hauv qhov chaws tso cai muaj qhov yuav ncua ntxiv htm lossis html, tom qab ntawd cov php code yuav tsis raug tswj los ntawm tus neeg rau zaub mov - txuas ntxiv yuav tsum yog "php". Yog tias PHP code ntawm tsab ntawv tsis nyob hauv ib daim ntawv cais thiab pib nrog lub <? php lossis tsuas yog <?, tom qab ntawd koj yuav tsum ntxig nws ncaj qha rau hauv nplooj ntawv, tsis muaj qhov txuas mus rau lwm cov ntaub ntawv sab nraud. Cov blocks ntawm PHP code tuaj yeem tawg thoob plaws ntau qhov chaw ntawm HTML code ntawm nplooj ntawv. Hais txog qhov PHP-serips, qhov kev qhia tseem tseem ceeb tshaj rau cov neeg siv sab sau ntawv - kev siv tsis raug ntawm cov server sab-scripts tuaj yeem ua rau koj lub vev xaib cov ntaub ntawv khaws tseg rau hauv server!

Kauj ruam 3

Tus txheej txheem heev rau kev ntxig cov code rau hauv nplooj ntawv yog tib yam rau ob qho tib si rau server thiab client scripts. Yog tias koj muaj cov ntaub ntawv, thawj kauj ruam yog xa mus rau lub server. Qhov no tuaj yeem ua tiav raws li FTP-raws tu qauv, siv cov haujlwm tshwj xeeb (FTP-tus thov kev pab). Pom zoo li cov ntawv thov hauv lub vev xaib tsis yog qhov nyuaj - piv txwv li, Zoo nkauj FTP, FlashFXP, FileZilla, WS FTP, Ntse FTP, thiab lwm yam. Kev rub tawm siv cov neeg siv FTP yog ua siv lub FTP raws tu qauv (Cov Ntaub Ntawv Hloov Chaw). Tab sis koj tuaj yeem upload cov ntaub ntawv ncaj qha los ntawm qhov browser siv cov ntaub ntawv tus thawj tswj hwm muaj nyob hauv cov ntsiab lus tswj kev tswj hwm thiab hauv cov tswj hwm hosting. Tom qab muab cov ntaub ntawv (lossis cov ntaub ntawv) rau lub server, koj yuav tsum kho cov HTML code ntawm nplooj ntawv Cov. Qhov no tuaj yeem ua tiav los ntawm qhov browser yog tias koj tab tom siv kev tswj hwm lub ntsiab lus. Lub kaw lus yuav tsum muaj nplooj ntawv editor, nyob rau hauv uas koj xav tau qhib nplooj ntawv yuav tsum tau, hloov tus kho hloov mus rau HTML code kho hom, ntxig cov cai npaj thiab txuag cov kev hloov pauv. Yog tias tsis muaj cov tswj hwm, tom qab ntawd rub tawm cov nplooj ntawv rau koj lub khoos phis tawm, kho nws nrog cov ntawv nyeem yooj yooj yim thiab muab nws xa rov qab rau lub server.

Pom zoo: