Tag Archive - website

Securing Passwords With PHP

Any website that stores users login information has to store their passwords. One thing that provides an extra layer of security for your users information is to do one way encryption on their passwords. You could in theory store their passwords as plain text, but if someone were able to get in to your database, they would have instant access to every users account.

One way encryption allows the password to be store in a secure manner. In fact it is so secure that you cannot decrypt it to recover the encrypted data. In order to authenticate the user you actually have to encrypt submitted data and compare the results that way.

One of the most widely used ways to accomplish one way encryption is to create an MD5 hash of the password. Lucky for us, it is so incredibly easy to create an MD5 hash of a string. You simply use the function md5(). See the example below:

<?

$encrypted_password = md5("secret");

?>

The value of $encrypted_password is the secured password.

PHP Hello World

Not be cliché, but I any book, tutorial or website discusses a programming language always begins with a program that simply displays the text “Hello World” on the screen and I intend to follow that tradition.

The process of writing text in PHP requires you to use either the “echo” of “print” function. There are some very minute differences between these two functions, but for these purposes, we will just say that they are interchangeable. If you really want to know the differences, there is an article that details this here.

Anyways, here is the hello world program for PHP.

<?
echo "Hello World";
?>

You could also use the print function and that would look like this:

<?
print "Hello World";
?>

You will notice that at the end of each line of code there is a semi-colon. Like many other languages, this is used at the end of most of the lines of code.

A Brand New Look, Some Changes, and An Announcement

I have made a lot of different changes to the website this weekend and I thought I should let everyone know about what is happening with the website.

First are foremost, I have changed the design of the website. I was never truly satisfied with the old look and I like this one a lot better. Your comments are welcome, but please remember that I am a programmer, not a designer (so constructive criticism only).

You will also notice that I have removed all advertising from the website. It hurt the look of the site and nobody was clicking on them anyways. There will still be advertising in the RSS feed, but that is the only place for now. No advertising now means that I can get rid of that ugly privacy policy.

I would also like to take this time to announce the launch of a new website that I will begin doing called Learn PHP Now. It will cover the exact same type of topics as this website, but with PHP. There were posts on this website where using PHP would have been very helpful to some of you, but it was not within the scope of this website to do so. So now I can fill in that gap with the launch of Learn PHP Now.

Learn PHP Now Coming Soon

Welcome to Learn PHP Now.  This website is brand new and in the coming days will provide you with tutorials, news coverage, and other general information about the PHP programming language.

So please stand by while we launch this website!