This Javascript code will display a calendar in a table, useful for date picking...
This Javascript code will display a calendar in a table, useful for date picking...
A useful function if you want to convert a link in plain text into a clickable link...
If you are selling a digital product and want to offer it for download but are concerned that people will share the URL to the file, you could use a solution like ClickBank. However the advantage of setting up one time downloads from your server instead is that you have more control over what you are selling and you don't have to pay any fee's.
Let us assume that you have setup and integrated a payment solution (such as PayPal using the IPN, post coming soon on this) and you have a database setup that holds the payment information.
reCAPTCHA helps prevent automated abuse of your site (such as comment spam or bogus registrations) by using a CAPTCHA to ensure that only humans perform certain actions.
You may have seen reCAPTCHA in use on many websites (including our forum) as it's completely free and comes with an excellent web service which we are going to implement in this article.
The first thing to do is sign up to reCAPTCHA to receive your public and private key. These keys are used to authorize your account.
Next you need to download the reCAPTCHA library in PHP which can be found on this page. Once you have this you are ready to go.
First we are going to store the public and private key in variables, this would usually go in something like config.php.
When sending mail in PHP its always best to use an SMTP server rather than the mail() function, and the ideal candidate for the job is PHPMailer.
Assuming you have an SMTP server (usually mail.yourdomain.com) and a username and password (to authenticate as some servers won't allow you to send via SMTP without it) sending mail with PHPMailer is easy as pie.
For websites that send lots of emails with different information it's a good idea to setup some email templates.
In this example we will create a folder called "email_templates" and will create a file called "register.html" which will contain the login information when someone registers to our site: