Forum Moderators: coopster

Message Too Old, No Replies

Reading cookies

         

Altec88

9:41 pm on Mar 6, 2006 (gmt 0)

10+ Year Member



Hello,
I'm trying to set up a user name/password setup to my site. The username/password system works now.

BUT now, I need cookies.

I'm having problems trying to make it so when you go to the homepage, it tells you if your logged in or not in the upper right corner. The cookies are called register and login.

I have this code to work with.

<?php

foreach ( $_COOKIE as $key => $value )
print ( "<tr>
<td> $key </td>
<td> $value </td>
</tr>" );
?>

Where do I go from here? I'm lost.......

Thanks!

jatar_k

5:19 pm on Mar 8, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



does that code output the values properly?

does it output the username?

I don't know what the variable is called but a guess might lead to something like this

echo $_COOKIE['username'];