PHP-and-MySQL/C4/Cookies-Part-2/Gujarati
From Script | Spoken-Tutorial
| Time | Narration |
|---|---|
| 0:00 | સ્વાગત છે. સારાંશ માટે – કૂકીના પ્રથમ ભાગના ટ્યુટોરીયલમાં, આપણે શીખ્યા કૂકીઝ કેવી રીતે બનાવવું, કુકીને સમાપ્તિ તારીખ કેવી રીતે આપવું અને કોઈ ચોક્કસ કૂકીઝને કેવી રીતે પ્રિન્ટ કરવું. |
| 0:13 | અહીં આ આદેશ વાપરીને, આપણે એ પણ શીખ્યા કે કેવી રીતે દરેક કૂકીને પ્રિન્ટ કરવી જે આપણે સંગ્રહિત કરી હતી. |
| 0:18 | તો આપણે કૂકીઝ બનાવેલ છે એ ધારી, આગામી વસ્તુ જે હું કરીશ તે છે એક ચોક્કસ કુકી અસ્તિત્વમાં છે કે નહી તે ચકાસવા માટે તેનો અહીં ઉપયોગ કરીશ. |
| 0:28 | આ કરવા માટે, એક "isset" નામનું ફન્કશનનો ઉપયોગ કરીશ. |
| 0:32 | આ મૂળભૂત રીતે કંઈક સેટ થયું છે કે નહી તે આધાર ઉપર આ true અથવા false વેલ્યુ રીટર્ન કરશે. |
| 0:37 | ઉદાહરણ તરીકે - કૂકી, હું ડૉલર સાઇન મૂકીશ અને પછી અન્ડરસ્કોર કુકી. |
| 0:42 | અને અહીં 'name' મૂકીશું. |
| 0:46 | તો જો હું આ ઇંગલિશ ભાષામાં વાંચું તો હું કહીશ - |
| 0:49 | જો કૂકી નામ સુયોજિત છે, તો “Cookie is set” એકો કરીશું. |
| 0:57 | નહિં તો યુઝર સામે "Cookie is not set" એકો કરીશું. |
| 1:01 | મેં કુકી સુયોજિત કરી છે અને તે કામ કરે છે એમ ધારી, જ્યારે હું આ રીફ્રેશ કરું છું તો "Cookie is set" મેસેજ મળે છે. |
| 1:11 | હવે કુકી કેવી રીતે અનસેટ કરવું તે હું તમને શીખવીશ. |
| 1:14 | તો ચાલો અહીં કહીએ - 'if' સ્ટેટમેન્ટ પહેલાં, હું મારી કૂકી સુયોજિત કરવા ઈચ્છું છું. |
| 1:20 | તો unset cookie. |
| 1:21 | તો ફક્ત નામ માટે, હું આ કૂકી અનસેટ કરીશ, |
| 1:25 | એવું માનીએ કે જો તમે આ અનસેટ કરતા જાણો છો તો આ પણ અનસેટ કરી શકો છો. |
| 1:31 | તો હું આ name કુકી અનસેટ કરીશ. |
| 1:34 | તો અનસેટ કરવા માટે આપણે 'setcookie' આદેશ જ વાપરીશું. |
| 1:39 | તો આપણે કૂકી રીસેટ કરી રહ્યા છીએ. |
| 1:41 | This doesn’t seem to make any sense but it will soon. |
| 1:45 | Now we will set the cookie name to nothing. |
| 1:49 | And our expiry date here... |
| 1:51 | I'll create a new one with "exp unset" |
| 1:55 | And that is gonna equal to the time minus 86400. |
| 2:01 | Here we said plus which meant that the time is in the future. |
| 2:05 | Now by setting the cookie to this variable which represents a time in the future, we are actually unsetting the cookie. |
| 2:13 | So if I were to say - set a cookie that already exists called name, to 'no value' at all. |
| 2:20 | And use “exp unset” variable to set it to a time in the future, thereby 'unsetting' our cookie. |
| 2:28 | So I'll get rid of this code for now and run this page, okay? |
| 2:34 | Nothing has happened presuming my cookie is unset. |
| 2:40 | Now I want to get rid of this code - so I'll comment this out. |
| 2:45 | And I'll put my 'if' statement back into my page. |
| 2:48 | Now presuming this says - is the cookie set name? I'm going to unset the cookie which should get the result "Cookie is not set". |
| 2:56 | Lets refresh and we got "Cookie is not set". |
| 3:02 | And then from here you can set it again if you like and you can change the values of the cookie. |
| 3:08 | To change the value of a cookie, you'll have to use 'setcookie' command again. |
| 3:13 | You’ll say - set cookie name and here just type a new value |
| 3:17 | So its not hard to work with cookies. |
| 3:19 | Its quiet an easy process. |
| 3:21 | And it’s a very very useful thing in php |
| 3:23 | So use it to your heart’s content. Okay. Thanks for watching. |
| 3:27 | If you have any questions, please let me know. |
| 3:30 | This is Evan Varkey dubbing for the Spoken Tutorial Project. Bye. |