Cookie problem

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

Post Reply
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Cookie problem

Post by ddragas »

I don't think this is setting a good cookie because I can not read values from this cookie

Code: Select all

<?php
session_start();
$broj_klijenta = $_SESSION['broj_klijenta'];
$email = $_SESSION['e-mail'] = $_POST['e-mail'];
$password = $_SESSION['lozinka'] = $_POST['lozinka'];
$kuki = $_POST['zapamti'];

				if(isset($kuki))
					{
														setcookie("email", $email,  time()+36000);
						setcookie("lozinka", md5($password),  time()+36000);
					}
?>

Code for reading cookie value

Code: Select all

if (isset($_COOKIE["email"]))
echo "Welcome " . $_COOKIE["email"] . "!<br />";
Please help me with this onekuki))
{
setcookie(&quote;email&quote;, $email, time()+36000);
setcookie(&quote;lozinka&quote;, md5($password), time()+36000);
}
?&gt;




Code for reading cookie value

Code: Select all

if (isset($_COOKIE["email"]))
echo "Welcome " . $_COOKIE["email"] . "!<br />";
Please help me with this one$_SESSION['broj_klijenta'];
$email = $_SESSION['e-mail'] = $_POST['e-mail'];
$password = $_SESSION['lozinka'] = $_POST['lozinka'];
$kuki = $_POST['zapamti'];

if(isset($kuki))
{
setcookie(&quote;email&quote;, $email, time()+36000);
setcookie(&quote;lozinka&quote;, md5($password), time()+36000);
}
?&gt;




Code for reading cookie value

Code: Select all

if (isset($_COOKIE["email"]))
echo "Welcome " . $_COOKIE["email"] . "!<br />";
[/php#1111;'zapamti'];

				if(isset($kuki))
					{
														setcookie("email", $email,  time()+36000);
						setcookie("lozinka", md5($password),  time()+36000);
					}
?>

Code for reading cookie value

Code: Select all

if (isset($_COOKIE["email"]))
echo "Welcome " . $_COOKIE["email&e;, $email,  time()+36000);
						setcookie("lozinka", md5($password),  time()+36000);
					}
?>

Code for reading cookie value

Code: Select all

if (isset($_COOKIE["email"]))
echo "Welcome " . $_COOKIE["email"] . "!<br />";
Please help me with this oneookie

Code: Select all

<?php
session_start();
$broj_klijenta = $_SESSION['broj_klijenta'];
$email = $_SESSION['e-mail'] = $_POST['e-mail'];
$password = $_SESSION['lozinka'] = $_POST['lozinka'];
$kuki = $_POST['zapamti'];

				if(isset($kuki))
					{
														setcookie("email", $email,  time()+36000);
						setcookie("lozinka", md5($password),  time()+36000);
					}
?>

[/php:1:e4a510cc1 is setting a good cookie because I can not read values from this cookie

Code: Select all

<?php
session_start();
$broj_klijenta = $_SESSION['broj_klijenta'];
$email = $_SESSION['e-mail'] = $_POST['e-mail'];
$password = $_SESSION['lozinka'] = $_POST['lozinka'];
$kuki = $_POST['zapamti'];

				if(isset($kuki))
					{
														setcookie("email", $email,  time()+36000);
						setcookie("lozinka", md5($password),  time()+36000);
					}
?>

Code for reading cookie value

Code: Select all

if (isset($_COOKIE["email"]))
echo "Welcome " . $_COOKIE["email"] . "!<br />";
Please help me with this onetart();
$broj_klijenta = $_SESSION['broj_klijenta'];
$email = $_SESSION['e-mail'] = $_POSTї'e-mail'];
$password = $_SESSIONї'lozinka'] = $_POST['lozinka'];
$kuki = $_POST['zapamti'];

if(isset($kuki))
{
setcookie("email", $email, time()+36000);
setcookie("lozinka&quote;, md5($password), time()+36000);
}
?&gt;




Code for readimail'] = $_POSTї'e-mail'];
$password = $_SESSIONї'lozinka'] = $_POSTї'lozinka'];
$kuki = $_POST['zapamti'];

if(isset($kuki))
{
setcookie(&quote;email&quote;, $email, time()+36000);
setcookie(&quote;lozinka&quote;, md5($password), time()+36000);
}
?&gt;




Code for reading cookie value

Code: Select all

if (isset($_COOKIE&#1111ssion_start();
$broj_klijenta = $_SESSION['broj_klijenta'];
$email = $_SESSION['e-mail'] = $_POST['e-mail'];
$password = $_SESSION['lozinka'] = $_POST['lozinka'];
$kuki = $_POST['zapamti'];

				if(isset($kuki))
					{
														setcookie("email", $email,  time()+36000);
						setcookie("lozinka", md5($password),  time()+36000);
					}
?>

Code for reading cookie value

Code: Select all

if (isset($_COOKIE["email"]))
echo "Welcome " . $_COOKIE["email"] . "!<br /&am_start();
$broj_klijenta = $_SESSION['broj_klijenta'];
$email = $_SESSION['e-mail'] = $_POST['e-mail'];
$password = $_SESSION['lozinka'] = $_POST['lozinka'];
$kuki = $_POST['zapamti'];

				if(isset($kuki))
					{
														setcookie("email", $email,  time()+36000);
						setcookie("lozinka", md5($password),  time()+36000);
					}
?>

Code for reading cookie value

Code: Select all

if (isset($_COOKIE["email"]))
echo "Welcome " . $_COOKil", $email,  time()+36000);
						setcookie("lozinka", md5($password),  time()+36000);
					}
?>

Code for reading cookie value

Code: Select all

if (isset($_COOKIE["email"]))
echo "Welcome " . $_COOKIE["email"] . "!<br />";
Please help me with this one
?>




Code for reading cookie value

Code: Select all

if (isset($_COOKIE["email"]))
echo "Welcome " . $_COOKIE["email"] . "!<br />";
Please help me with this one
<?php
session_start();
$broj_klijenta = $_SESSION['broj_klijenta'];
$email = $_SESSION['e-mail'] = $_POST['e-mail'];
$password = $_SESSION['lozinka'] = $_POST['lozinka'];
$kuki = $_POST['zapamti'];

if(isset($kuki))
{
setcookie("email", $email, time()+36000);
setcookie("lozinka", md5($password), time()+36000);
}
?>




Code for reading cookie value

Code: Select all

if (isset($_COOKIE["email"]))
echo "Welcome " . $_COOKIE["email"] . "!<br />";
Please help me with this one
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

looks to be in order to me. Are you trying to echo it the value on the same page as you're setting it? If so, that won't work. Also have you checked to make sure cookies are enabled on the browser on which you're testing?
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

Yes cookies are enabled and retriving values from cookie in another page.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you might try echoing $email before you set your cookie to make sure it has a value...
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

It is working now

Thank you
Post Reply