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!
My code is displaying the articles regardless of what I type into the form fields and it is not suppose to. Can someone please tell me why this is happening? Thanks in advance.
Here is the code that I am working with:
<?php
// If there is a cookie set named 'username' and ...
// If there is a cookie set named 'password' (I really hope this is not what I think it is)
if (isset($_COOKIE['username']) && ($_COOKIE['password'])) {
// Output the username in the cookie to the browser
print "Logged in as: ".$_COOKIE['username']. "<br />";
// Dispay a link
print "<a href=logout.php>log out?</a>";
}
/**
* Do you see how your validation check looks for
* a 'username' and 'password' cookie, then if there
* are two cookies set with those names, it displays
* the user name?
*
* The only way the username gets shown is within
* the check for set cookies. This would be a nice
* little area to do what you want to do.
**/
?>