rulururu

post Secure Contact Form

July 29th, 2008

Filed under: code, software — bigw @ 2:16 pm

If you are looking for a secure and reliable contact form for your website. Please check out

http://www.dagondesign.com/articles/secure-php-form-mailer-script/

The emphases here is on secure, many times these scripts are terribly exploited by spammers, this one seems to be well done. I have used it on many sites myself.

Here is a sample screen shot of the contact form.

You can use the “reCAPTCHA” tool, or the script has it’s on method using GD.

post Prevent Hotlinking from Specific Sites Only

July 2nd, 2008

Filed under: code, tools — bigw @ 11:29 am

You want to prvent hotlinking.

But not ALL websites. Sometimes you don’t mind if someone hotlinks from a forum or a review about your product, etc. However there are those that you DO want to block.

You can use the code below and place it into your htaccess file.

I placed the code in the .htaccess file inside my images folder, to just protect that folder, and to keep things straight forward.

If you wish to send a differnt image to the offending website, change the last line to an image that is outside your domain, or in a folder a level above where your .htaccess file is located.

Example: If I placed the code in the .htaccess file inside http://example.com/images, then my “nohotlink.jpg” image should be located http://example.com/nohotlink.jpg (otherwise it will blocked by it’s own rule).

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?ebay\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?ebay\.ca/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?abc\.net/ [NC]
RewriteRule .*\.(jpg|gif|bmp|png)$ http://example.com/nohotlink.jpg [L]

post Paid link? Don’t forget to remove after the contract

June 26th, 2008

Filed under: code — bigw @ 4:20 pm

Here is some quick php code to help with paid links. If you have a paid link on your site with a set expiration date, it can be hard to remember to remove the link after the date. Here is some quick code to put in place when you place the link, so you can set it and forget it! (as they say)

<?
//set your link expiration date here.
$expiry = strtotime(”8/12/2008″);
$today = strtotime(”now”);

if ($today > $expiry) {
$new_status = ‘<p>non-paid link info</p>’;
} else {
$new_status = ‘<p>paid link info</p>’;
}
echo $new_status;
?>

Simple, right.

ruldrurd
Powered by WordPress Entries (RSS) and Comments (RSS)