Monday, December 29, 2008

Animated Gif Loading Thingies

Check out this site:

www.ajaxload.info

It's where I got this:



And this:



Blogger may or may not be animating them, but go to the site and you'll see what they are supposed to look like.

I've used it twice already. One on this site: LifeChurchOnline.net and one on a site I am working on that's not up yet.

On the church site I used it during the onload:redirect. I built the page as a wordpress blog, but they needed to keep their domain name for server space. You'll see the little graphic while you wait for the redirect. (otherwise it looked like the site was just sitting there not doing anything while it redirected).

The other time I am using it is as a background image in a table cell, then on top of that table cell, I added another table, and that table has a script I found that changes the background image of the table cell.

The reason I did that was because I needed the image in the table cell to be wider than the width of the page so that as the page stretches for different resolutions, the image will still be there. If I added the image in the table cell, it forced the table to be the width of the image, but I wanted the whole site to be 100%...scalable.

But, the images were taking a little too long to load, and basically had a white area there while it loaded. Now it has a little loading graphic.

Here's a sneak peek of the home page of the site I'm building, but it won't be there forever. And none of the back end programming is working...it's still in the design stages.

Tuesday, December 23, 2008

Getting Spam through my PHP Contact Form

OK, so I have a previous post that explains how to make a PHP contact form. Easy enough. It works great. Well, a few months ago I started getting spam emails from my contact form. This is lame. Basically, a bot has found my contact form, and it's been flooding my inbox with fake email addresses, and 5 or 6 url links in the message.

I thought I would append my initial post with what I've done to fix the problem.

1. Rename the form
(add a "2" or something) Like this: before=contactForm.php; after=contactForm2.php. Which means you will need to make sure the path in the html form is pointing to the right place.

2. Add a "hidden" field in the contact form.

Like this:
<input type="text" name="email2" style="display:none" />
<input type="hidden" name="redirect_thanks_url" value="http://www.yourdomain.com/thankyou.htm" />

I put it between the last text field and above the submit button, but it doesn't matter where you put it...in fact, we might all help defeat spam bots if we put them in different places and even name the fields differently. In this example it's "email2"...see in the code above, and also in the php code below.

3. Add this php code to the for script (which you can download from the other post I talked about).

if(isset($_POST["email2"])) {
if(!empty($_POST["email2"])) {
# THIS IS PROBABLY SPAM
header("Location: ".$_POST["redirect_thanks_url"]);
exit();
}
}

You'll need to add it somewhere in the code inside the main opening and closing php code, make sure you don't put it inside another function. I put mine right after line 12 in the script mentioned on the other post.

What it's doing is basically telling the spam bot that there is a field to fill in. Bots are attracted to fields. So we attract it with a label like "email2" or "message" or something that's not already in use, but still attractive...not something like "honeypot" or "spamtrap".

It's hidden from humans, so if it's a human filling out the form, the script checks to see if the field is blank. If it's not blank, the script tosses the submission, but redirects to a thank you. I read that some bots wait to see if the redirect goes to an error page or not, then will try again.

Now, it's possible that spammers will teach their bots to look for "hidden" fields and not fill them in at some point, but then we can come up with something else.

For the time being, this helps.

Again, the contact form on the previous post still works just fine, but I'm afraid it's just a matter of time before a spam bot finds it and starts spamming you.

Hopefully you remembered where you got the script in the first place and checked back to see if there was a solution.

What a pain this spam thing is. It's like a battle of escalations and counter attacks. Kinda fun, just annoying and time wasting.

I looked into some CAPTCHA solutions but it was really difficult to implement, and most of them cost money. (CAPTCHA by the way means "Completely Automated Public Turing test to tell Computers and Humans Apart"

Hope this helps.

jorge

Tuesday, December 16, 2008

New Christmas Game Called "Ball Hanger"

Last year, some of you may have see my "Bobblehead Nativity" Flash toy thing.

Well, this year, I've gone and made another Christmas game. This time it has to do with hanging balls on a tree. Check it out.

And have a safe and wonderful time with your friends and family.

Stay tuned this year for more games on my website. I've got some puzzles, a couple of "shooters" and some other things I'm working on.

Oh, and do you have a cell phone? Check out my free ringtones. Free...like a Christmas present. Yay.

Jorge