podcastsuggest

Archive

Posts Tagged ‘PHP’
rss
mail

My first WordPress Plugin: Project Honey Pot

September 11th, 2009 No comments

I hate spam. I hate it. That's why I've been a participant in Project Honey Pot for the past several years.  For those who don't know what Project Honey Pot is, here's their About page

To summarize, the project catches spammers by putting fake e-mail addresses on special pages that only harvesters crawling websites should ever find.  When one of those addresses get spam, they've caught a harvester and know exactly when and from what IP the e-mail address was harvested.

It only just recently occurred to me that there really is no good WordPress plugin that allows you to hide honey pot links in your website. So I wrote one.

I was surprised at how easy it was actually. I hope it's helpful to someone, somewhere.

Go to the plugin page now

international
feedback

PHP - Redirect and continue (without abort)

June 28th, 2009tools 2 comments

The Problem

Sometimes, in PHP, we have to do things that take a long time (like converting user-submitted videos, say), but there's a problem with that: the user has to wait until we're done with whatever we're doing.  The worst part is, it looks like their request was dropped because the browser just sits there "loading" forever and shows no sign of progress until the page is finally done loading or - *shudder* - times out.

Solutions

There are a few strategies to solve this problem:

  1. You could have your PHP script create a cron job on the server.  This approach is overly complex in my opinion and has some problems: You have to be running your PHP code on a Linux server, and you have to have access to cron - not really an option for most people who don't host their own server.
  2. You could write a special PHP script that gets called via AJAX after the page is loaded and returns the results from the operation.  That works just fine and is a great option for someone comfortable with AJAX.  I've actually used this strategy myself, but it's still too complicated for my taste.
  3. My weapon of choice: The PHP redirect and continue.

Read more...

store
contact
blog
podcast