Category: Web development

  • Trouble with PHP versions after migrating to an M1 Macbook

    I migrated a Time Machine backup from a 2015 Intel High Sierra to a 2021 M1 Monterey. I love the computer, and the migration was largely a success. I use Laravel Valet to run and develop local websites. They break every time I restart the new machine. php -v from Terminal always returns 8.0, but […]

  • Troubleshooting VS Code, xDebug, and Laravel Valet on macOS

    Problem: xDebug is not showing up in phpInfo() output Run <?php phpInfo(); in a browser and look for “with Xdebug” like is shown near the bottom left of this screenshot: There’s also a large section of xDebug settings near the bottom of the page. Here’s mine: If you do not see xDebug in these locations […]

  • Solving a Confusing MigrationBlocker While Moving to Azure SQL Database

    This week, I’m altering functions and stored procedures in a SQL Server 2008 database so that it can be migrated to Azure. The Data Migration Assistant does a great job of generating reports identifying MigrationBlockers, but one type of error was vague enough to confuse me for a few minutes. Here’s an example of that […]

  • 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

    Disguise your email address or any text with this character obfuscation. This code &#99;&#111;&#114;&#101;&#121;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109; will show up on a web page as [email protected] You can share your email address without worrying that it will be collected by a spam bot. Enter some plain text Obfuscate Some losers send spam email for a living, and will […]

  • 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 […]

  • 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 […]