Kev rau npe hauv lub xaib yog qhov kev xaiv ua tau ntawm nplooj ntawv. Rau tus kheej nplooj ntawv ntawm lub vev xaib kev sib raug zoo lossis lub vev xaib - cov npav ua lag luam, nws muaj peev xwm ua yam tsis muaj nws. Rau cov khw muag khoom online lossis chaw txuas nrog tus qhua coob, koj yuav tsum tsim daim ntawv tso cai.
Cov Lus Qhia
Kauj ruam 1
Siv server mechanism uas tsim cov sijhawm tshwj xeeb uas khaws txhua yam ntaub ntawv hais txog tus qhua thaum nws taug kev los ntawm nplooj ntawv ntawm lub xaib. Nws yuav qhia tus neeg siv khoom txog kev tsocai. Lwm zaus koj nkag mus hauv browser, tus neeg rau zaub mov yuav tsim ib qho kev sib ntsib tshiab, thiab php tsab ntawv yuav qhib kev nkag mus rau cov neeg siv raug cai rau nplooj ntawv, lossis hais kom lwm tus qhua nkag mus rau kev nkag mus thiab tus password.
Kauj ruam 2
Txhawm rau ua qhov no, tsim ib nplooj ntawv rau cov ntaub ntawv nkag. Encode cov ntaub ntawv ID nkag mus hauv HTML. Ntxiv php-code mus rau thaum pib, nws yuav tswj tau qhov tseeb ntawm tus password thiab nkag mus nkag los ntawm tus neeg siv khoom. Nco ntsoov ntxiv qhov lus txib "session_start ();", uas yuav pab tau koj kom pib lub sijhawm tshiab, uas tseem tsis tau tsim rau tus qhua tshwj xeeb.
Kauj ruam 3
Tsim ib daim ntawv txawv tsuas muaj php code. Nws yuav txuas mus rau nplooj ntawv tseeb uas xav tau kev tiv thaiv password. Npe nws "auth.php" (qhov no yog ib txwm muaj rau cov ntaub ntawv ntawd). Tom qab php tag, tso cov kab lus "session_start ();" rov hais dua.
Kauj ruam 4
Txuas cov ntawv tsocai tso cai rau txhua cov ntaub ntawv khaws cia ntawm tus neeg rau zaub mov uas xav tau kev tiv thaiv los ntawm cov neeg siv tsis raug. Nws yog ib qho tsim nyog sau cov cai thaum pib ntawm txhua php-nplooj.
Kauj ruam 5
Siv lwm txoj hauv kev los ua daim foos rau kev tso cai. Rub tawm lub plugin (Daim ntawv sau npe kub, Fancybox, thiab lwm yam) siv qhov txuas ntawm tus tsim tawm lub vev xaib, piv txwv li code.google.com. Sau cov chaw thiab cov style ntawm lub pop-up window rau nws. Txhawm rau pib zais qhov kev tso cai thaiv, nkag mus rau hauv qhov chaws.
Kauj Ruam 6
Nruab lub plugin. Mus rau nws kom kho qhov tshwm sim uas siv CSS yeej. Txuag cov chaw thiab xyuas nws ua haujlwm. Yog tias txhua yam ua tiav zoo, tab me me yuav tshwm rau sab saum toj ntawm qhov chaw, thaum koj nyem rau ntawm nws, lub qhov rais qhib nrog teb rau nkag mus rau cov ntaub ntawv qhua (tus ID nkag mus, lo lus zais).