VileWorks

Password (un)Masking

Windows Vista has a nice option labeled Show characters right below password input fields:

Windows Vista "Show characters" checkbox under a password field

Windows Vista "Show characters" checkbox under a password field

And Useit.com recommends itIt’s time to show most passwords in clear text as users type them. So without further ado, here’s what it looks like on the web: unmasking the password field

This is the HTML code from the example:

Continue reading…

19 Comments.

PHP Screencast: Hidden Captcha

As I was saying in a past–not so documented–article, this is how the Hidden Captcha concept works:

Does the user have JavaScript enabled?
If yes, they’re okay — let’em comment, no annoying captcha required.
No? We’ve got a suspect. Read them their rights and serve them the ultimate “are you human?” test.

I made this 5 minute screencast to earn fame and fortune on Nettuts, but I’m also posting it here along with some textual comments. Figured I’d make it easier for you to copy/paste the whole 2 lines of JavaScript.

Here’s what you start with, the source code from this tutorial.
(Note: be sure to have the Arial font file called arial.ttf in the fonts folder–copy it from your System in there because their archive does not come with it).

This is the JavaScript/PHP I’m pasting in:

<script type="text/javascript">
<!--	
	document.getElementsByName('code')[0].value = '<?php echo $string; ?>';
	document.getElementById('captcha').style.display = 'none';
 
-->
</script>

Both lines of JavaScript work on elements from this chunk of HTML:

<div id="captcha">
	<img src="captcha.php"/>
	<p><input type="text" name="code" /> Are you human?</p>
</div>

The first line of JavaScript sets the correct value for the code text field.
And the second line of JavaScript sets display:none to the captcha div, thus hiding it from anyone with JavaScript enabled.

Hidden Captcha instead of Akismet?

Continue reading…

12 Comments.

Using captcha without displaying it

How I use captcha without making my users complete the barely readable word

Capthca sucks. For more information on how much captcha can suck see John Willis’ post Top 10 Worst Captchas.Bad Captcha
But at the same time it can be really annoying for webmasters to have their forms unprotected with all the spam bots running free out there.

What I wanted was to have the commenting feature protected against spam bots without having the innocent human users ruining their eyes on captcha like images, or complete any mathematical equation or any other additional question fields.

One very important difference between a spam bot and a human using a web browser is that the first can’t run JavaScript code. However, this isn’t a perfect criteria of selection, because there are humans browsing the web using browsers without JavaScript support (Opera Mini for mobile devices for example).

My ideea (and as I did some Google searches, I found out other people had similar ideas) was the followig algorithm:

Does the user have JavaScript enabled?
If yes, he’s ok. Let him comment.
No? He’s a suspect. Read him his rights and give him the ultimate “are you human?” test.

To do this I left the captcha system enabled and in place and wrote 2 extra lines of JavaScript that:

//complete the text field with the correct word from the image:
$('secretword').value='nospam';
//hide the div containing the captcha image and the text field:
$('captcha').style.display='none';

Continue reading…

18 Comments.

Reasons not to use flash

Deamon of FearWhy shouldn’t you use flash for your website? Can there be anything wrong with a website that “enhances” the user experience by flying/zooming/swirling/flipping in like a .PPS document?

Well, besides the lack of SEO, low usability (for example: back button not working, “find on this page” not working, the “make text bigger/smaller” button not working etcetera), nonstandard user interface, fully flash based sites are pretty much ok.

This is a really old issue and of course modern technology offers solutions like Flex for powerful web applications, but unfortunately the web is still filled with flash based sites… which use flash just for the design’s sake.

I’m not stating here that flash is bad or anything. It actually is GREAT! It’s the best choice right now for online streaming video or audio, the only choice for some web applications or games, a good way to make your banner ads stand out (even though this can be really annoying for the visitors but that’s a different topic).

Seeing how this is such an old topic, I need not to go in any more details as some people excellently did that already:

Making god use of flash: When you should and shouldn’t use it. Is Flash going to help me in communicating with my audience?

Flash: 99% Bad.

Really, people… these things are so last decade even my article looks old fashioned. There’s all the talk about web 2.0 and taking this paradigm to the next level… Do you think the definitions “the web as a platform” or “the web as a database” can include your site that not even Google can index due to the fact that the only navigation you have between pages is a flash menu?

3 Comments.