looking for a brokerage account or IRA... click here Add To Favorites
return to index 

PHP Cookie And Authentication

You can use cookies to easily administrate a website. In fact, I used one cookie on this website so that I see additional links like: edit, add, delete, etc. The basic strategy is to use it like an authentication. In essence, you want code like...

if($password="123")
   setCookie("isAuthenicated",1);

Then, in your web page, you might want to have a code snippet like...

if(isset($_COOKIE['isAuthenticated'])){
    if($_COOKIE['isAuthenticated']==1)
        echo "This is an admistrative feature.";
    else
        header("Location= login.php");
}

Additional Interesting Articles

Execute Files Remotely Using PSExec
PHP All Over Again
Pearson Coefficient
Automatically Redirect People To Different Landing Pages in PHP
SQL Check Existence of Table or Temp Table
SQL Difference Between IS NULL and =NULL

©2008 AndrewKimball.com