• 12Nov

    According to the PHP Security Consortium

    A hash (also called a hash code, digest, or message digest) can be thought of as the digital fingerprint of a piece of data. You can easily generate a fixed length hash for any text string using a one-way mathematical process. It is next to impossible to (efficiently) recover the original text from a hash alone. It is also vastly unlikely that any different text string will give you an identical hash – a ‘hash collision’. These properties make hashes ideally suited for storing your application’s passwords. Why? Because although an attacker may compromise a part of your system and reveal your list of password hashes, they can’t determine from the hashes alone what the real passwords are.

    I suggest that every PHP programmer get acquainted with hashing, as it can be very useful for recognizing valid data. I explain the simple usage in this two-part tutorial.
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    Showing the Use of Hashes
    Generating hashes
    The difference between certain algorithms
    You can find this tutorial video on youtube here.

    Read more…

  • 12Nov

    Here is a tutorial with a remake of the game my friend made. Note, this is not his source code. I made it right on the spot. Also, my mic was off the first time, so this is a voice over.
    This three-part tutorial goes over using arrays, loops and sessions to create a simple grid based game. There is no true object to the game other than to move around and hit your head on the boundaries (the edges of the grid).
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    Here is my tutorial of the game my friend made.
    Note, This is not his source code,
    but I made it right on the spot.
    Also, my mic was off the first time,
    so this is a voice over.
    You can find this tutorial video on youtube here.

    Read more…

  • 12Nov

    In PHP, it is really useful to be able to open files and get the information out of them. You can also use files you get the contents of and manipulate them like a template. By using file_get_contents I am able to get the contents of other files, manipulate and output them.
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    Getting the contents of another file
    Editing it, and returning the manipulated content
    This can be used for "cheapo" templates
    You can find this tutorial video on youtube here.

    Read more…

  • 12Nov

    Sometimes it is necessary to destroy a session. If you are familiar with a log in system, usually there is a “Log Out” too. Essentially, when you log in, you have a session, when you log out, that session is destroyed so others cannot latch onto the old data and leach out your personal info for their nefarious purposes. Here I demonstrate a quick and dirty not-so-realistic log in system and a way to log out. I also prove that the session is destroyed by showing a certain page’s differences when I am logged in and not.
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    How to destroy a Session, like logging out
    An example of logging in and out(fake
    since I haven’t taught how to do password
    management safely yet)
    You can find this tutorial video on youtube here.

    Read more…

  • 11Nov

    There are times where we don’t want every page to depend on form submissions and we want some of the data for and about the user to be retained throughout their session. A session is a length of time that something happens. In this case, the user’s data is kept from each page until the session is destroyed by their own choice(or yours), or they are not active for a length of time and it is dropped. We can access and change this data by using the $_SESSION variable. This is like a cookie, but temporary and the user has absolutely no access to it except a ticket with their Unique generated ID. Please watch this two-part tutorial to learn about sessions and how to apply them.
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    What are sessions?
    They keep info from one page and if you
    click on a link in the same site, it
    also keeps that info available to the server.
    You can find this tutorial video on youtube here.

    Read more…

  • 11Nov

    Sometimes it is best to shorten our coding by making our own functions that we can use more than once but only require only one line the second time.
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    Build a function
    Use a custom function
    You can find this tutorial video on youtube here.

    Read more…

  • 11Nov

    In this three-part tutorial, I make up a dynamic story as I go along using a lot of the functions that I have taught about before. If you would like to see another way of applying variables and functions called array, count, date, echo, mktime, and rand: it is highly suggested you take your time and watch this tutorial.
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    Use Previous functions to make up a story
    Use some random generation to do some
    story randomization that is used later
    Have Fun
    You can find this tutorial video on youtube here.

    Read more…

  • 11Nov

    Sometimes we need to make up a timestamp to save in a database, or to compare with other dates. mktime() essentially creates the same thing that time() does but according to the dates you provide inside of mktime(). Here is the form that you would put in it.
    mktime ([ int $hour = date("H") [, int $minute = date("i") [, int $second = date("s") [, int $month = date("n") [, int $day = date("j") [, int $year = date("Y") [, int $is_dst = -1 ]]]]]]] )
    the brackets mean that they are optional values, however, since the first is optional, and you want to fill in say the 4th, you will have to fill in all the parameters until that point.
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    Making Time
    Using the date function to show the made up time
    You can find this tutorial video on youtube here.

    Read more…

  • 11Nov

    In PHP, you can get the current time through several methods. You can use the self-explanatory time() function, or you can use the date function with a format parameter for what to return.
    For example:
    echo date(‘l jS \of F Y h:i:s A’);
    returns something like Monday 8th of August 2005 03:12:46 PM…
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    Dates
    Time
    In Function form
    You can find this tutorial video on youtube here.

    Read more…

  • 10Nov

    If the title confuses you, don’t fret. My tutorial will explain it to you. Strings, as we know in compu-speak is text. Well, if you want to get part of the text but not all of it, you can use substring. Then if you want to find the position of some text to use in the substring function , you can use the function for that to find the matches for what you put in. However, if there is no match it will default to 0.
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    Parts of strings
    Positions in Strings
    String lengths once more
    You can find this tutorial video on youtube here.

    Read more…

« Previous Entries   Next Entries »