Home Logo
Show Full Menu
Hide Full Menu
 

PHPMyAdmin

Created: 12/10/10 Views: 2308 myFave Image


In this tutorial we will learn PHPMyAdmin
In this tutorial we are going to look at PHPMyAdmin. PHPMyAdmin is the nice little user interface of MySQL, it is here where you can control your databases, tables and data. This really is the MySQL centre and it is vital you can use it, and hopefully you can as it is pretty simple.

Depending on how you are following these tutorials, whether it's Xampp or on an actual host makes a difference to how you access PHPMyAdmin, if you are following on Xampp, please refer to the Xampp tutorials, if you are using a live host, log into your Cpanel and click on PHPMyAdmin.
    4 basic parts for a cookie
  • name this is the name given to the cookie so you can call it at another time
  • value this is the value of that cookie
  • expiration this is how long the cookie is set for before it is deleted
  • path this is where on the site the cookie is available


So why would we really want to use this?
  • To allow the 'remember me?' part of a login form
  • To remember the users username for them
  • To keep a few specific settings for that user
  • To be able to tell the last time the user logged in


    How to create a cookie
  • <?php
  • setcookie("name", "value", expiration_in_seconds, "path");

  • setcookie("user", "benj", time()+(60*24*60*60), "/"); //60 days; 24 hours; 60 mins; 60secs
  • ?>

    Call and Print Cookie
  • <?php
  • print $_COOKIE['name'];

  • print $_COOKIE['user'];
  • ?>

    Result
  • benj

    Delete Cookie
  • <?php
  • setcookie("name", "value", expiration_in_seconds, "path");

  • setcookie("user", "benj", time()-3000, "/"); //3000 seconds ago
  • ?>



You should give this a go for yourself, creating a cookie on one page, closing the browser or restarting and then calling it on again as well as finally destroying it.


next tutorial: Data Relationships

There are no comments