Thaum tsim lub vev xaib, webmasters feem ntau muab sijhawm rau cov neeg siv xa cov ntawv sau rau tus tswj hwm kev pabcuam. Rau qhov no, siv ib daim ntawv tshwj xeeb. Koj tuaj yeem sau cov qauv yooj yim ntawm daim foos no koj tus kheej.
Cov Lus Qhia
Kauj ruam 1
Raws li txoj cai, hauv daim ntawv rau xa ntawv ntawm lub xaib muaj ob lub teb tseem ceeb: cov lus xov header teb thiab daim teb rau nkag mus rau cov kab ntawv xov. Tus xa tawm tsis tas yuav qhia tus email chaw nyob ntawm tus tswj hwm chaw, vim nws tau sau rau hauv txoj cai nws tus kheej. Qhov kev xaiv no yooj yim vim tias cov thawj tswj hwm tuaj yeem tau txais cov ntawv tsis qhia nws qhov chaw nyob email.
Kauj ruam 2
Daim ntawv nws tus kheej, hauv cov ntawv nyeem uas yuav nkag mus, yog sau ua html yooj yim. Txoj cai yuav yog qee yam zoo li no:
Xov:
Kauj ruam 3
Cov cai saum toj saud yuav tsim ib daim foos nrog ob daim teb - Cov Ntawv thiab Xov. Tseem yuav muaj ob lub nyees khawm ntawm nws - "Xa" thiab "Tsuag". Koj tuaj yeem tso cov code no rau qhov chaw yooj yim ntawm nplooj ntawv nplooj ntawv. Daim foos yuav yog tam sim no, tab sis tseem tsis tau ua haujlwm. Rau khawm nyem kom ua rau cov txiaj ntsig xav tau, koj yuav tsum ntxiv cov ntawv sau PHP hauv qab no rau lub xaib:
<?
$ rau = "email @ chaw nyob";
xa ntawv ($ rau, "$ sub", $ mes);
?>
Kauj ruam 4
Hloov kab "email @ chaw nyob" nrog txoj kev xaib e-mail. Luam cov ntawv sau rau hauv ib txwm muaj "Boknot", khaws nws li xa.php (thawj zaug khaws nws li xa.txt, tom qab ntawd pauv lub npe txuas rau *.php) thiab muab nws tso rau hauv cov ntawv tais ceev tseg nrog nplooj ntawv site. Nov yog qhov yooj yim tshaj plaws ntawm daim foos rau xa ntawv, koj tuaj yeem hloov pauv thiab kho ua kom zoo raws li koj xav tau. Piv txwv li, los ntawm kev ntxiv cov lus ncha rau cov ntawv, koj tuaj yeem tso tawm qhov no lossis cov lus hauv qab no tom qab xa ntawv. Koj tuaj yeem hloov qhov loj me ntawm daim ntawv, nws cov xim, khawm cov npe, thiab lwm yam ntawm koj qhov kev txiav txim.