PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ddragas
Forum Contributor
Posts: 445 Joined: Sun Apr 18, 2004 4:01 pm
Post
by ddragas » Mon Jul 12, 2004 3:48 pm
I have problems with cookies.
to set up cookie I use this and it works
Code: Select all
<?php
$expires_soon = date("l, d-M-y H:i:s", time() + 54000);
setcookie( "email=$email; expires=$expires_soon;");
setcookie( "lozinka=$lozinka; expires=$expires_soon;");
?>
how to read from cookie?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Jul 12, 2004 3:51 pm
print_r($_COOKIE)
ddragas
Forum Contributor
Posts: 445 Joined: Sun Apr 18, 2004 4:01 pm
Post
by ddragas » Tue Jul 13, 2004 2:35 pm
Thank you for reply, And how to put retrived data from cookie to variable?
I've set in coockie values of email and password.
example
$email=email from cookie
$password=password from cookie
with print_r($_COOKIE) i get all values from cookie
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Jul 13, 2004 2:53 pm
Code: Select all
<?php
$email = $_COOKIE['email'];
$password = $_COOKIE['password'];
?>or whatever names you give each cookie...