PHP-and-MySQL/C4/Sending-Email-Part-2/Khasi

From Script | Spoken-Tutorial
Jump to: navigation, search
Time Narration
00:00 Kabiang, te ngi lah dep shna ia ka HTML form jong ngi hangne bad batai ba ka data lah dep process lyngba jong u POST variable ha ka por ba la submit ia ka formjong ngi.
00:12 Ka kam babud ba ngan leh kadei ban shu check katto katne ki conditions halor kane, tang na ka bynta jong ka jinghikai.
00:22 Ngan ong lada ka string length...
00:25 Em, nyngkong eh ngan check na ka bynta ka jingdon. Te lada ka if $name bad ka $message,
00:30 Kane ka shu dei ban ong kane ka don bad kane kadon namar katba ki dang don, kin don barabor ia u True value.
00:38 Bad ngi ia pyndonkam ia u "AND" operator (&&) hangne uba ong "is this true AND is this true".
00:45 Lada kane ka dei TRUE, ngin execute ia u code hangne.
00:49 Lym kumta nga kwah ban kill ia kane ka script bad ngan ong "You must enter a name and message".
01:04 Bad lehse shu underline ia katei na ka bynta ka jingkylla.
01:07 Bad hapoh jong ka block jong u code jong ngi, lada kane kadei TRUE ngin leh sa kawei pat ka jing check.
01:14 Te , hangne ngi don checked ryngkat bad ka jingdon check.
01:20 Bad mynta hangne kaba ngin leh kadei run sa ia kawei pat ka check.
01:25 Kumno nga lah ban ong ia ka? Ngan leh ia ka length check. Te ngan comment ia kane kum length check.
01:32 Ngin ong $name lane ka length jong ka string da kaba pyndonkam ia ka string-length function.
01:40 Ngi check lada kane ka string-length function jong ka '$name' ka kham heh – em, kham rit lane ka iaryngkat bad ka 'max length' jong ngi kaba dei '20'. Ngi lah ban don uno uno u number hangne.
01:55 Bad ka string –length jong ka'$message' ka kham rit lane iaryngkat bad 300 characters. Khlem pep, phi lah ban don uno uno u number hangne, ruh.
02:12 Nangta ngin execute ia kane ka block jong u code.
02:16 Lym kumta ngin ong "Max length for name is 20 and max length for message is 300".
02:30 Khlem pep ka kam babha badei ban leh kadei ban buh 300 bad 20 ha ki variables.
02:36 To ngin save ia ki hangne. Te, phi lah ban ong "$namelen" ka iaryngkat bad 20 bad phi lah ban ong "$messagelen ka iaryngkat bad 300.
02:47 Nangta kaba phi lah ban leh kadei, pynrung ia kane hangne. Te "$namelen" hangtei.... oooops te "$namelen" hangtei.
02:55 Bad hangne phi lah ban ong – Oh! To ngin buh biang ia katei – bad hangne phi lah ban ong "$messagelen".
03:04 Hangne harum ruh kumjuh, bujli ia kine. Te, kine kin sa shah bujli lada phi leh ia ka check.
03:12 Te, hangne phi ong "$messagelen".
03:15 To ngin test ia kane. Ka "namelen" kam dei ban palat ia ki 20 characters. Te, hangne ngi lah ban pyndap ia ki characters kibym palat ia ka 20 characters. Te, Alex hangne.
03:26 Ha Message, ngan pyndap katto katne ki text, palat ban ia ka 300 characters ka jingjrong. Ngan shu copy paste ia kane.
03:33 Katei kadei ban palat ban ia ki 300 characters mynta.
03:38 Te, lada nga nion ha Send me this button, ngi ioh ia ka message - "The max length of the name is 20..." utei udei u variable uba lah dep buh hangtei hajrong.
03:49 Bad ka maximum length na ka bynta kane kadei 300; udei sa uwei pat u variable uba lah shim nangne.
03:56 Ngi ia shim ia ka check bad echo ia une u variable ruh kumjuh.
04:02 Da kaba shu shim ba baroh kiei kiei ki biang ngin ia pynioh ia ka email ba la phah sha u user.
04:07 Nga iai ban ia kane, kadei ka address hangne bad ngi la ioh lypa ia ka subject line jong ngi hangne.
04:13 Tangba ngi lah ban wanrah ia kine hangne hapoh; kam don jingmut ban set ia u variable lada ka email kam pat long ba la khreh ban send.
04:20 Te, kane kadei ka 'setup variables' jong ngi. Ngi don ruh ia ....
04:32 Ngi lah ban ong "from" tangba kane ka iasyriem sha ka email address.
04:38 Te ngi lah ioh lypa ia ka "name" bad ngi donkam shisha ia ka "message" kaba sa shisien kadon hangne.
04:46 Ngi donkam ruh katto katne ki jingtip shaphang ki header kiba ngan sa pyni shen hi ia phi tangba ngan iaid beit beit sha ka "mail function".
04:58 Ka "mail function" ka long kumne harum - mail bad u variable banyngkong phi donkam ban kynthup udei iano kane ka message dei ban phah "to". Te ngan type $to.
05:11 Nangta ka subject jong ka email kaba dei tang $subject.
05:15 Kadon hangne. Nangta ngi don ia ka body jong ka email, te $body.
05:20 Hangne ngin ong $body ka iaryngkat bad kane harum - "This is an email from $name". Te ngin lah dep kynthup ia ka '$name' hapoh ka body jong ka email.
05:36 Nangta, shu pyndonkam backslash n (\n) uba dei u new line, te kitei ki 2 tylli ki new lines.
05:42 Kaba bud, ngin echo ia ka '$message' kaba yn sa kynthup ha kane.
05:49 Te, ka '$body' jong ngi ka don ia ka generic message hangne, ka kyrteng jong u user ba ngi lah dep process ha ka form bad nangta artyllli ki new lines bad nangta ngi lah dep pyndap ia ka '$message' kaba lah dep pyndap ha ka form jong ngi hangne. Biang?
06:03 Te, to ngin iaid lait na kine.
06:06 Katei ka biang ban iaid shakhmat.
06:09 Kum ka 'mail function', phi lah ban pyrkhat kumno katei ka lah ban treikam tangba ban phah email php ka suk bha.
06:21 Tangba haba ngi phah shisha ia ka email, ngi lah ban iohi ba kidon katto katne ki jingeh.
06:27 Ngi ioh ia ka jingmaham - "the mail() function "send mail_from" is not set in 'php dot ini' or custom "From:" header missing".
06:36 Nga khlem pat set ia ka "send mail from" ha ka 'ini' jong nga. Nga la klet ia katei. Te ngan leh hi ia ka.
06:44 Hadien ba ngi lah dep leh ia kane, ngin run ia ka ha kawei ka error ruh kumjuh.
06:48 Ngan sa hikai ia phi kumno ban pynbeit ia ka tangba ha ka bynta babud jong ka video.
06:52 Ha ka bynta kaba bud , ngin treikam bad kiwei ki errors ba ngi ioh hadien katei.
06:56 Te sa iasnoh bad nga ha ka bynta babud. Khublei Shibun. Nga i Meboreen na Shillong, nga dubbed na ka bynta ka Spoken Tutorial Project.

Contributors and Content Editors

Meboreen Mary