PHP-and-MySQL/C4/User-Password-Change-Part-2/Khasi

From Script | Spoken-Tutorial
Jump to: navigation, search
Time Narration
00:00 Ngi pdiangsngewbha ia phi sha ka bynta ba ar jong ka jinghikai Change Password Ha ka jinghikai ba shwa, ngi lah pule kumno ban check lada ki forms jong ngi lah dep submit.
00:09 Ngi don ia ki data values jong ngi hangne.
00:13 Sngewbha kynmaw ba hapoh ka database jong ngi, ki passwords jong ngi lah encrypt.
00:18 Te , ha mar ba kine ki fields ki wan, ngan encrypt ia ki hapoh jong ka md 5 hash.
00:27 Pynthikna ba phi buh ia ki brackets.
00:35 Kaba nga lah dep highlight hangne kadei ka parameter jong ngi.
00:38 Te, hangne ngin don ia ki "md5" encrypted passwords jong ngi.
00:43 Ngin sa donkam ban check ia kane ka field ban peit lada ki don ne em.
00:51 Ha kane ka khyllipmat haba ngi submit ia ka form jong ngi, ngi iohi ba kam don jingjia eiei.
00:57 Nyngkong ngan ong “check password against db” bad nangta ngi hap ban connect sha ka database jong ngi.
01:08 Ngi lah dep connect lypa sha ka database jong ngi ha kiba bun ki pages – kum ka login page.
01:15 Phi lah ban buh ia kane sha kawei ka file, shu ong “include” bad include "connect .php” ryngkat bad ka one time login script hapoh, te khnang ba phin nym donkam ban iai type ia ka.
01:29 Tangba na ka bynta ka jinghikai , ngan type ia ka sa shisien namar kane kadei ka rukom kaba biang ban pule.
01:35 Ngi type hangne - "$connect = mysql_connect()".
01:40 Bad ngin sa connect sha ka "local host" database jong ngi, ryngkat bad ka username kum "root" bad ka password kum nothing; ngan jied ia ka database jong nga.
01:50 Te, kata kadei “phplogin” kaba don hangne. To ngin leit hangtei bad phi lah ban iohi ia ka hangtei.
01:58 Ka table jong ngi kadei "users" kaba ngi lah ban pyndonkam hadien habud.
02:01 Kaba bud ngin shna ia ka query ban ioh ia ki passwords.
02:05 Te ngan type “ $query get” kaba iaryngkat bad ka mysql...... "mysql_query" bad hangne ngin type ia ka "SELECT password" – Ngi donkam ban pynshisha ia ka password na ka database "users".
02:26 Phi lah ban iohi hangne. Kane kadei ka "users" table.
02:31 Nangta ngi type “WHERE username is equal to $user”. Kane kadei ka session variable jong ngi kaba don ia u user’s 'username'.
02:39 Te, kaba ngi leh kadei ngi iajied ia ka password hash jong ngi na kane ka table ha kaba ka "username' ka iaryngkat bad ka kyrteng jong ka session bad katei kan iaryngkat bad “Alex”.
02:49 Te katei kan dei ka query kaba jop. Bad phi lah ban type ha kaba kut or die "Query didn’t work”"

Katto katne ka error message.

02:59 Phi lah ban don jingmutdur bad kine ki error messages bad type kaba phi kwah.
03:08 Kumjuh hangne, phi lah ban ong or die. Phi lah ban pyndap la ka jong ka error message hangne tangba ban kunai ia ka por, ngan nym leh ia ka mynta.
03:17 Mynta, ngin pyndonkam ia kane kham pher, shwa ba ngin pyndonkam ia ka while function ban loop ia baroh ki record ha ka database.
03:25 Lah pyntip ia nga shaphang kane ka method lyngba ka comment ba post mano re. Ngan ong "$row = mysql_fetch_associative". Bad katei ka "$query get".
03:41 Ngin set ia ka “$old password db” kaba dei ka kyrteng jong u variable bathymmai. Wat bakla ia kane bad ka '$old password' kaba lah dep submit.
03:50 Ka password barim ha ka database jong ngi kan iaryngkat bad ka '$row' jong ngi.
03:55 Kynmaw, kane ka shna ia ka array.
03:58 Te, une u value udei "password" namar hapoh ka database jong ngi, kane kadei ka “password” hangne. Phi donkam ban pyndonkam ia ki labels.
04:06 Te, nangne shakhmat ngi lah ban check ia ki passwords jong ngi.
04:08 Ka jingcheck ia ki passwords barim bad ki passwords ba thymmai kadei tang ka if statement ba suk.
04:16 To ngin type – lada ka 'old password' ka iaryngkat bad ka 'old password inside the database'.
04:25 Kine baroh ar kidei 'md5 hashes' namar ngi lah pynkylla ia ki sha ka md5 hash mynshwa.
04:30 Te, lada ki iaryngkat te ngin ia ka run ia ka block jong u code, lym kumta ngin kill ia ka page bad ong ” Old password doesn’t match!”.
04:44 Te hangne, da kaba shu shim ba ngi la iaid lyngba ka kyrdan ba nyngkong jong ka jingpynshisha jong ngi, ngi check ia ka password barim bad ka password ba rim ha ka database. Mynta ngi donkam ban check ia ki artylli ki passwords bathymmai jong ngi.
04:57 Te kadei kaba suk kumba type if '$new password' ka iaryngkat bad '$repeat new password' te ngi lah ban thoh ia ka block jong u code; lym kumta ngi lah ban shu kill ia ka page bad ong “ New passwords don’t match!”.
05:20 Te hangne , kane kadei “success” bad nangta ngin ong “change password in database”.
05:31 Te mynta kaba ngan leh kadei echo“success” bad ngan phai biang sha ka page jong nga.
05:38 Ngan type ia ka password ba bakla da ka jingthmu. Te ngan shu type ia kane.
05:41 Ka password ba thymmai jong nga ngan type kum "abc" bad nangta da kaba nion ha Change password, ngi ioh ia ka message "Old password doesn’t match!".
05:49 Lada nga type "abc" kum ka password barim jong nga kaba kadei bad "123" kum ka password kaba thymmai bad nga bad kino kino ki dak ha kaba bud, ngi dei ban ioh ....... Oh "Old password doesn’t match!"
06:00 To ngin phai biang bad check ia u code. Password ba rim....row - password.... 'query get'...
06:13 Bad , kaba ngi lah ban leh hangne ban debug kadei: Shu ong echo '$old password db' bad ka break ha kaba kut bad shu ong echo 'old password' bad kawei pat ka break.
06:31 Kaba ngi lah ban leh mynta kadei, run ia ka script sa shisien. Te, ka password barim ka iaryngkat bad "abc", ka password ba thymmai ka iaryngkat bad "123" bad nangta kino kino ki letters.
06:44 Te, to ngin ia nujor ia kine. Kine baroh ar ki i kumjuh ia nga, te ngi lah ban iohi ba ngi ioh ia ka jingeh hangne.
06:50 Sa shisien, to ngin check ia u code. Check na ka bynta ki spellings.
07:15 Te, nga dang shu lap ia ka jingbakla. Lada nga phai biang sha ka database jong nga hangne, ngi iohi ba nga lah dep pyndap hi dalade ia une u value bad nga lah dep shna ia kane ka jaka ha kaba kut jong kane – phi lah ban iohi ba lah pynthaba ia ka ha ka rong blue – ngan shu iaid lait kloi kloi na kane bad ngan wanphai biang sha ka page jong nga.
07:33 Ngan login biang kumba ju leh bad mar mar pynkylla ia ka password jong nga, ngan buh ia ka password barim ha ka rukom ba dei bad kino kino ki text na ka bynta ki artylli ki passwords bathymmai jong nga.
07:45 Phi lah ban iohi ba ki artylli ki passwords ba thymmai jong nga kim iadei.
07:49 Ngi lah dep echo ia kane, te mynta ngi lah ban delete ia kane.
07:53 Da kaba shim ba ki passwords jong nga ki iadei, to ngan echo ia kane ka message ba jop.
07:58 Te, to ngin shu delete ia kine. Nga buh ia ki na ka bynta ka debugging.
08:02 Ngan shu type ia ka password ba rim jong nga , ka password ba thymmai 123 bad 123, nion Change password bad ngi ioh ia kaba dei.
08:10 Te, nga pan map na ka bynta ka jingbakla hangtei hajrong.
08:18 Te ha ka bynta ba lai jong kane ka jinghikai, ngin bteng bad ka jingupdate ia ka password jong u user bad ban shu pynthikna ba baroh ka treikam pura bha.
08:29 Khublei Shibun. Nga i Meboreen na Shillong nga dubbed na ka bynta ka Spoken Tutorial Project.

Contributors and Content Editors

Meboreen Mary