Showing posts with label general web development. Show all posts
Showing posts with label general web development. Show all posts

April 22, 2014

StackOverflow Like Pagination

Some while ago, I built a pagination system in PHP to display a long list of pagination links. The pagination system showed at most 5 links at a time and additional links were represented by ellipsis (...). However, I was not able to deal with certain edge cases, so I drew some inspiration from the pagination system used on StackOverflow to tackle them. This is what the end result looked like:

Pagination using ellipsis

July 19, 2012

Google Analytics Day of Week and Hour of Day Reports

Google Analytics provides very detailed analytics for your website; but there is always room for more. People who use (or have used) traditional web analytics software such as AWStats, Analog and Webalizer are familiar with the "days of week" and "rush hour" reports, neither of them are directly available in Google Analytics.

The traffic for a website vary by day of week and it is very useful to know when a website expects most (or least) visitors. Sometimes these statistics help you make decisions such as when to launch a promotion or take down a website for maintenance.

January 24, 2011

Multiple Submit Buttons: Changing Order of Default Button

When a form contains more than one submit button, the name-value pair submitted by the browser is that of the button that was activated (via click for example). But what happens if you press "Enter" to submit the form? The answer is simple: the name-value pair submitted by the browser is that of the first submit button that appears in the source.

October 27, 2008

Multiple Submit Buttons on HTML Forms: Alternate Methods

HTML forms often need to present a choice between two or more operations on the same data. Here is an example:

[x] User 1
[ ] User 2
[x] User 3

[ De-activate selected user(s) ] [ Permanently delete selected user(s) ]

In this article, I will outline few examples to accomplish this. All of the following examples refer to a field called "command" which specifies the operation to perform. Assume that the "verbosity" on the captions is required.