David Walsh Tutorials

  • By
    Adios Means Goodbye – Browser 301 Redirects In All Languages

    Browser redirects, especially 301 "permanent" redirects, are essential to all good web applications. Regardless of language, browser redirects can: provide safe URL forwarding to gather GET and POST variables and process them without risking data and processing integrity by a browser refresh send users and search engine...

  • By
    Fixing IIS & PHP Variables – Set $_SERVER[‘REQUEST_URI’] Yourself

    About 8 months into my programming career I needed to code a content management system (CMS). This was quite a challenge so early into my professional journey but I was up to it. The front-end was the easiest part of the project -- a...

  • By
    Advanced CSS – Using A Reset.css File To Gain Complete Control

    It took me about a year to feel as though I completely owned cascading style sheets. For a language (yes, it IS a language) with simple syntax, CSS optimization techniques can take quite a while to learn. Formulating your style sheets to do exactly...

  • By
    6 Reasons Why IE6 Must Die

    Internet Explorer 6, released on August 27, 2001, was a package of problems right from the start. Within a year of release, Microsoft silently declared that IE6 would not make enough money for them to continue supporting. The result has been numerous security problems...

  • By
    PHP Shorthand If/Else Using Ternary Operators (?:)

    An essential part of programming is evaluating conditions using if/else and switch/case statements. If / Else statements are easy to code and global to all languages. If / Else statements are great but they can be too long.I preach a lot about using shorthand...

  • By
    Weekend Links – jQuery 1.4, CSS Images, Printing Techniques, Converting to CSS, Cross-Browser Coding

    Not the most notable week in programming news, but why not share what's out there?jQuery 1.4 Released: Faster, More Tests, Ready for 1.2I don't use jQuery but I know that the community is strong and there are a lot of great scripts out there. WordPress...

  • By
    Fluid Anchors – Smooth Anchors Using MooTools

    While we as programmers get more used to using AJAX and advanced JavaScript frameworks, we can only assume that our users will. At one time, it was acceptable to have elements dynamically just "pop into" the screen but now we must strive to make the...

  • By
    Cross Browser CSS Min-Height

    As you know, Internet Explorer 6 does not follow CSS' "min-height" property. Luckily, we can fix this problem using the following CSS code snippet:Internet Explorer 6 is the only browser that recongizes the "* html _____" selector and thus is the only browser to read...

  • By
    Advanced CSS – Class Is Out – Avoiding Classes By Using Formatting Tags For Structure

    Nothing makes me cringe more than when I see other programmers use a class declaration for every XHTML tag in their programming. Using too many CSS class declarations can result in: Bloated page downloads for the user Bloated CSS file downloads for the user Difficulty in editing CSS...

  • By
    MooTools Image MouseOvers – Cleaner JavaScript Code, Less Hassle

    Creating mouseover code can be a real mess but using MooTools I put together a solution that saves me time and keeps my code super clean. There are some practices that I use with my theory. All "mouseover" versions of the image end in...