Posts Tagged ‘HTML’

Posted on November 10th, 2007

PayPal Buttons; Hide Email Addresses from Spam Bots


Lately I’ve been creating a lot of PayPal “Buy Now” and “Add to Cart” buttons for a few of my customer’s websites. The problem with creating these buttons is that they require an email address to be added to the HTML code, which in turn gets easily harvested by spam-bots.

A simple alternative to using an email address is to use a “referral code” instead. To get the referral code login to PayPal and click on “Referrals” located near the footer of the page. On that page you will find a link like: Copy the “VXDE78NC4F3K2” part of the code and replace the hidden input value of “business” with it in your button code.

Original Code:

Revised Code:

You may ask why I wouldn’t just use PayPal’s encrypted payment buttons. Well, By creating non-encrypted buttons you can easily edit them (e.g. change Price, Item Name, etc.), create new ones fast and dynamically input values via PHP.

Posted on January 13th, 2006

Using PHP on Pages with HTML Extensions

Recently I wanted to use PHP includes in an existing site so I could make updates to common parts of the site faster by editing one file (e.g.: header, navigation, footer, etc.). The problem was the site was designed with all pages ending in .html. Of coarse I could have changed all the pages to .php but the site has very good search engine rankings, and many other sites already link to these .html pages. After a little research, I found the solution to be the .htaccess file.

Since pages without a .php-extension will not be parsed by PHP by default on most web servers, you need to tell it to treat all HTML pages as PHP pages. You do this by simply adding a line to the .htaccess file located in your site’s root directory (or create a .htaccess file using a text editor). Just add:

AddType application/x-httpd-php .php .html .htm

Note: .htaccess files need to be placed in each directory that will make use of PHP in .html pages.

Update: If you get an 500 Internal Server Error try:

AddHandler application/x-httpd-php .php .html .htm