Entries tagged "Web Development"
Sorting HTML Data Tables Part 2: Dynamically Sort in Ascending and Descending Order
In last week's post we looked at dynamically sorting HTML data tables. But we only talked about sorting the columns in either ascending or descending. If the user is looking for a last name that appears near the end of the alphabet and the column is sorted from A to Z, they may have a lot of names to go through before finding the one they want. Instead we could provide an option for sorting in both descending and ascending order. [Continue reading]
Sorting HTML Data Tables Using the Header Row with PHP
When displaying data tables, how do you usually sort the information? Do you sort by the field that you think is the most important to the visitor? For example, it's perfectly acceptable to list entries chronologically; where the newest is shown first. But what if the user wants the data organized differently? We could let them choose. [Continue reading]
Archiving Old Code after Major Updates
After making major changes to a web page what do you do with the previous version? The old code could be tossed in the trash since it's unlikely to be needed again. However, there may be a time where someone discovers a critical bug that slipped through the cracks. Until fixed, it may be better to revert back to a fully-functional version. With that in mind, let's take a look at archiving. [Continue reading]
Making Website Changes on a Copy of a File Instead of the Original
When making major changes to a website, working on the "live" version of the file may be problematic. For example, if you've been performing updates for a while only to discover that you're heading in the wrong direction. Having the original file provides a safeguard in case there's a need to go back to the drawing board. The original file is also useful for making those quick updates which crop up before the larger renovations are done. So let's look into duplicating pages for updates. [Continue reading]
Making Sure that Updates Were Applied to a Web Page with HTML Comments
When modifying a website, the effects to the page are usually apparent. But when the changes only affect the backend, how do you know you're not viewing the old page? A successful update results in the same content being displayed as before the changes. Maybe the updated page was uploaded to the wrong location. Let's see how HTML comments can help. [Continue reading]
Maintaining a Hidden Content Archive Within a PHP Page
Do you have content that cycles regularly, such as a news feed, events calendar, etc. If so, there's a good chance that the current entries would serve as useful templates for future updates. "But where do I store these content templates?" Hey, thanks for asking. If you normally delete old information and are unsure where/how to archive it, let's take a closer look at one of the methods described in last week's post (Three Simple Methods for Hiding Website Content Until It’s Ready)—hiding content with PHP comments. [Continue reading]
Three Simple Methods for Hiding Website Content Until It’s Ready
How do you handle content that needs to be temporarily removed from a website? Maybe there is some text that gets recycled on a regular basis or something that hasn't been approved for posting yet. HTML comments could be utilized to hide everything until it's ready to go live. Just keep in mind that the content is still accessible via the browser for those who know where to look. If that's an issue, the information could be moved to a separate file and saved offline…or you could use PHP comments. [Continue reading]
Save Paper by Printing Multiple Pages to a Single Sheet with Microsoft Word
My personal preference is to avoid printing whenever possible. It's bad for the environment, it costs businesses money, and I really like seeing my desk. But there are times when printing seems inevitable. Maybe something is needed for a meeting and you won't have a computer—or internet access. There are still ways to reduce how much paper you use by printing more than one page per sheet. [Continue reading]
Utilizing the Short-hand if() within a PHP String
Until recently, one thing has eluded me when it comes to the Ternary Operator [aka the short-hand if()]. It's easy to assign the resulting value to a variable or to display it on the screen, but how is the short-hand if() used in conjunction with the concatenation character? In other words, how is it used in the middle of a PHP string? [Continue reading]
Getting Your Projects Done Faster by Writing Less Code with the Short-hand if()
Have you coded a simple if() construct that sets a variable to one of two values and thought to yourself "Five lines of code; there should be a better way?" Okay, maybe it's just me. Either way, let's take a look at the Ternary Operator [aka the short-hand if()]. [Continue reading]