Archive

Archive for the ‘PHP’ Category

How To Create a Simple Contact Us Page in PHP

August 10th, 2009 No comments

Every website should have a "Contact Us" form, with spam as horrific as it is in this day age webmasters can no longer feel safe just pasting there email address on the websites. I created what I consider to be a bare bones contact us form, which you can see a very similar example of. Also, make sure to scroll past the source code to view some recommended changes and additions to the form. Read more…

Categories: PHP Tags:

Generate MD5 and SHA1 Password Hash

August 9th, 2009 No comments

It’s really simple to generate a MD5 and SHA1 hash using PHP, it’s so simple that I even considered not posting this blog. But then I found myself Googling a website to generate a MD5 hash while I was at work. So I created a simple form for you to create your own MD5 and SHA1 hash. Read more…

Categories: PHP Tags: , ,

Sending eMails via PHP using the mail() function

August 8th, 2009 1 comment

Looking up the official PHP guide, we can see how to use the mail function, I’ll try and explain them here and give a few examples of how to add additional headers. Let’s move along the function header from left to right, the mail() function is declared as:

bool mail  ( string $to  , string $subject  , string $message  [, string $additional_headers  [, string $additional_parameters  ]] )

The first thing we see is that the mail function returns a bool, or boolean. So every time this function is run it will either tell you whether it was successfully sent or not. Now I want to be careful here, just because the message has been sent does not mean that the message ever made it to the users mailbox. The message could bounce back because you entered the wrong address, it was flagged as spam, the email address doesn’t exist anymore, etc… This is kind of like mail with the post office, just like when you put a stamp on a letter and mail it, you can say that the message was sent, but it doesn’t mean the message will ever be received. Read more…

Categories: PHP Tags: