Posts Tagged ‘php’

Apr 19 Why didn’t I think of this? Posted at 4:27 pm | No Comments »

I saw an interesting article on Yahoo! the other day. It appears that someone at Carnegie Mellon came up with the idea to use a CAPTCHA script to mask e-mail addresses. Basically, they provide you with special link code to put in place of your normal mailto link. You can use the link anyway you want, but the script generates some HTML code automatically that looks similar to:

user<a href="http://mailhide.recaptcha.net/d?k=01quxf658CWzRNQC34kj75Ug==&c=5Sc_I7orZzXLkOX6E7fontrPSKXj6NS2QC0a-5mV5Gk=" onclick="window.open('http://mailhide.recaptcha.net/d?k=01quxf658CWzRNQC34kj75Ug==&c=5Sc_I7orZzXLkOX6E7fontrPSKXj6NS2QC0a-5mV5Gk=', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;" title="Reveal this e-mail address">...</a>@example.com

In the example above, the whole e-mail address would actually be username@example.com, but the rest of the username is obscured by the script. Of course, they also supply you with just the address to the CAPTCHA page, so that you can build your own link any way you want.

The link, in turn, leads to a page with a CAPTCHA script. Once you correctly answer the CAPTCHA question, you’re lead to another page with the complete e-mail address. The script is called Mailhide, and it appears to be a completely free utility. It’s such a simple idea that I can’t believe no one thought of this before.

(more…)

Apr 17 Integrating Wordpress into dynamic templates Posted at 3:52 pm | No Comments »

I installed a Wordpress blog on my development server the other day and began playing with it. The first real challenge I faced was how to pull my Wordpress installation into my Web site’s template.

My issue is, I’m using a content management system (CMS) to manage the bulk of my Web site’s content. However, I wanted to use Wordpress to manage my various blogs. I obviously wanted my blogs to look like the rest of my Web site, so I needed to come up with a plan to integrate my Wordpress installation into my CMS, somehow.

Basically, what it came down to was that I needed to find a way to store all of my Wordpress output into PHP variables. Once I had done that, I could plug those variables into my template. The main problem I ran across, however, was the fact that 99% of the functions Wordpress uses to build its output utilize echo commands rather than simply returning the output.

That was no good for me, obviously, as it started printing content onto my page before the template had been processed.

PHP came to my rescue, and with very little headache. PHP’s output buffer was the simple answer to my problem.

(more…)

Apr 9 fileNice - a PHP-based file browser Posted at 5:43 pm | No Comments »

fileNice - a free PHP-based file browserWhile working on one of my Web sites the other day, I had the need to install some sort of file browsing script that would allow the user to choose a particular file, then insert a link using TinyMCE.

I realize that MCEFileManager is available, but it is commercial software, and I was really looking for something free.

I happened across a script called fileNice. It’s a pretty nice file browser and is extremely simple to use. There are quite a few things I probably would have done differently had I written the script, but it works pretty well, and it took me about five minutes to install and configure rather than five weeks (or months) writing my own full-featured file browser.

(more…)

Mar 11 Rewrite and Redirect for IIS - Sort of Posted at 9:28 pm | No Comments »

Last week at work, we unveiled one of the new Web sites I’ve been working on for a while.  In doing so, we removed the old Web site completely from the server and replaced it with the new site.

Of course, when we did so, a lot of our old links became obsolete, so I had to find an effective solution to keep our regular visitors from going bananas when they tried to access some of their favorite pages.  That’s when I began to look into some options for redirecting without having to create placeholder pages just for those redirects.  After quite a few fruitless searches, I was able to piece together a fairly good solution, and also discovered an easy way to achieve URL rewriting on an IIS server (similar to the way you would with htaccess on an apache server).

First, you need to set up your “404″ so that it points to a VBScript page.  That’s the most important part.  Once you’ve got that done, navigate to a page that you know does not exist on your server, just so you can test the behavior of your 404 page.

(more…)

KickApps
Clicky Web Analytics

community discussion