Home
Home Page
In detail about Robots.txt
Safe programming on PHP
We write elementary rassylhhik
Use of HTML-tables for a conclusion of diagrams
What is dorvei? Whether Banjat for them?
How to learn{find out} on what searches find my site in search machines?
Cunnings of tabulared design. (we form a framework of the table)
The guest book on PHP
BB-codes
We hide counters
Use of patterns of design in ASP.NET
RSS the generator
Search optimization of a site
Metatags
Optimization for MSN
We
Cookies - fresh rolls
Superdynamical webs - interfaces
Links
 

Cookies - fresh rolls

Job with kuki from PHP is facilitated up to impossibility. All that is required to you, it only to learn{find out} some functions. And then you can ship your users in their world and in many respects to facilitate their life on your site.

So, the first that to you should be taught{learnt}, it how to put kuki to the user.

Completely anything complex , use function setcookie (). Its{her} general{common} format.



<? php

int setcookie (string name [, string value [, int expire [, string path [, string domain [, int secure]]]]])

?>


So we should specify a name kuki and its{her} value. Other fields are not obligatory are time of a life kuki (before which date), on what directory we put, on what domain and whether safety kuki (it is used seldom) is necessary.


Example.



<? php

setcookie ("TestCookie", " Ded Mozor ");


/* And these kuki live only one hour */

setcookie ("TestCookie", $value, time () +3600);


/* Only for a directory user a site *phpdevs.com */

setcookie ("TestCookie", $value, time () +3600, "/user / ", ".phpdevs.com", 1);

?>


For removal{distance} kuki simply put empty value.

<? php

setcookie ("TestCookie", " ");

?>


Now we read kuki.



<? php

$my_cookie = $HTTP_COOKIE_VARS ["TestCookie"];

?>


As you can see all is very simple up to a disgrace.