Web development


Detecting mixed case strings in ASP Classic

I needed to detect a mixed case string in classic ASP. I define a mixed case string as containing both upper and lower case characters, like AuxagGsrLpa. I could not find a free function on the web to make this decision, so I wrote one. = 65 and asc( currentChar ) = 97 and asc( [...]

Matching MD5 hashes in ASP.NET and ASP Classic

The goal of this page is to put two MD5 code samples on the same web page, one for ASP classic and one for ASP.NET. String formatting (like ASCII vs UTF-8) can trip up coding these two routines. These two code samples will produce the same MD5 hash output. Classic ASP/VBScript MD5 The ASP code [...]

“Time ago” formatting in ASP classic

Today, I needed to convert a time stamp like “1/25/2011 10:42:11 AM” to a readable sentence format like “2 months and 6 hours ago.” Here’s the code I came up with: function timeAgo( byval time ) sentence = “” hits = 0 piecesAgo = array( 0, 0, 0, 0, 0, 0 ) piecesTotals = array( [...]

Clear default text from input boxes using Javascript

Providing labels is a great way to help users interact with your website properly. I like to put instructional text inside text boxes to save space. Users get annoyed when the text inside the box they click on does not disappear when they are ready to type. Users do not want to backspace default instructional [...]

Classic ASP and Server.GetLastError in IIS7

My classic ASP error logging scripts were dead in the water when I moved them to a Windows Server 2008 with IIS 7.0. Some code like this is useful to record errors in a database: dim objErrorInfo, errorStringStr set objErrorInfo = Server.GetLastError errorStringStr = objErrorInfo.File & “, line: ” & objErrorInfo.Line & “, error: ” [...]

Disguise Email Addresses for online publishing

I just wrote this quick ASP code to disguise email addresses on web pages. There is a better way to obfuscate email addresses. I recommend creating an image instead of using text in every case, but sometimes a plain text email address link is effective. Some losers send spam email for a living, and will [...]

GoDaddy email authentication errors

GoDaddy offers a decent email account for a few dollars a month. These mail servers are picky about what ports are used to send outgoing messages based on where the message originates. I think I have cracked the case. If you are encountering either of the following errors, you are welcome. When sending outgoing messages [...]

PHP4 Friendly htmlspecialchars_decode

I needed to use the PHP function htmlspecialchars_decode( ) for a WordPress widget I am making. This function is built into PHP versions 5.1.0 and greater and is used to convert special HTML entities to characters. As defined, htmlspecialchars_decode( ) is the opposite of htmlspecialchars( ). Someone named Thomas commented on the PHP man page [...]

Winning The Web’s IM Top Blogs Icon

Last week, Gyutae Park announced Internet Marketing Top Blogs, a modern day top sites list based on a handful of high profile metrics. Admittedly, I heard about this through the grapevine. Quadszilla commented that while the idea was interesting, the icon badge was a little ugly. The badge is, of course, a great idea for [...]

Label tag width not working

The <label> element will not accept a width value in FireFox, and I just spent way too long finding a workaround. The label element is used to associate a text label to a form control that does not automatically have a label. Short answer: float left makes width work on label elements. When assigning a [...]

Next Page »

 

Thanks for reading!

Sign up for email updates: