Markup Tutorials

  • Watch Your POST: Save PHP POST Data as XML

    One of my main goals when creating PHP web forms is to keep them secure and protected from spammers and automated bots. With the amount of spam that Akismet catches every day, I don't need to be reminded of the importance of securing forms. Since 90+% of my forms are POST transmissions, I've taken a lot of time to develop POST debugging and listening code.

  • Creating Advanced XHTML Email Links: Include Subject, CC, BCC, and Email Body

    Creating email links is a piece of cake, right? It's as simple as:

  • Automatically Refresh a Page Using JavaScript or Meta Tags

    I try to steer clear of modifying a page without the user triggering the change, much less automatically refresh or redirect a page. There are times when automatically refreshing the page is important, like when you pull up game play-by-play pages on NFL.com or ESPN.com. Whatever your reason for automatically refreshing the page, keep one thing in mind: auto-refresh only pages that have little interaction — nothing more than a click.

  • Advanced CSS Printing — Using CSS Page Breaks

    I have one customer that absolutely insists his web pages print perfectly. Why? Because he refuses to look at his pages on the screen — he tells his employees to print the website for him to look at. And since he looks at pages that way, he believes most of his customers do just this.

  • HTML Test – Name The HTML Elements

    If you're looking to test your HTML knowledge (and who isn't?), take a trip to the justsayhi website. How many elements can you name in five minutes?

  • Compress Your XHTML Page Output Using PHP Output Buffers

    Us programmers love to keep our code readable and neat, which is why we use hundreds of tabs and line feeds in our code. The problem with doing this in the web programming world is that our users don't care about our neatly indented code. They don't care about our detailed code comments. They certainly don't care about the two-vs-three-vs-four spaces in a tab debate. So why should we make them download the extra code? With some quick PHP code, you don't need to.

  • 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 experience smoother for our users. That's why MooTools has put a big focus on the "Fx" part of their framework.

  • 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:

  • Advanced CSS Tables – Using CSS3 For Alternate Row Colors

    CSS finally addresses an issue that I've been peeved wasn't fixed earlier. The DIV movement of getting away from table-based design taught us that tables should be used only when you're presenting a table of data on your website, yet no CSS selector/rule was created to allow us to shade alternate rows a different color. Isn't that a basic design / usability need?

  • Remove Internet Explorer’s Gallery Image Toolbar

    Long ago Internet Explorer introduced the Gallery Image Toolbar which places a toolbar over an image if you hover over the image for a second. I've never seen anyone use it and it is more of an annoyance than anything else. There are two ways to prevent the toolbar from displaying: