Allowing a developer to access a visitor’s browsing history is a huge security risk, that’s why it’s not possible. If you own a website that runs PHP with MySQL and handles sessions then this could be done by tracking IP addresses, user agents and so on to associate a browsing pattern with a particular person. This however can be pretty inaccurate, plus it’s only limited to your own website.

So what are we going to use? Well when you think about it, a user’s browsing history is stored on their computer, client-side. And what else runs client-side that us web developers can make? JavaScript and CSS. These are what we’re going to use. Read more »

The URL fragment anchor (or accelerator, ID link or jump point) can be used to relocate the visitor to a specific part of a page. This is done by giving an element an ID then linking to it with a hash symbol (# or number/pound sign) like so:

http://example.com/page.php#content

The “content” part of this URL however never gets passed to PHP since it is only used client-side. However, with a little bit of help from JavaScript we can do exactly that. Read more »

PHP sessions are great for dealing with log in systems, tracking user activity, and allowing them to save data as they move around your site, like a shopping cart. Writing up what you need to run it though can be a bit painful, so that’s what lead me onto creating a custom session handling class in PHP. Read more »

One service that I had used a while back was AddThis social bookmarks. I really liked its ease of use, support for a huge range of social networks and bookmarking sites, and most importantly it had great tools for analytics.

The social bar itself however left more to be desired. It was an eyesore, appearing after every post on my site, and made me cringe at the fact that it relied on JavaScript to function. Luckily, I found an alternative in the form of their API docs. Read more »

Back in September of last year, Jim Greer of Kongregate.com posted an article in the forums about a new badge data service served in JSON. This was great news for developers, we could finally grab data from our user accounts without having to do a web scrape on our user page.

However, this forum post seems to be the only official documentation on what is a very interesting data feed, so it is with this reason that I decided to create this beginner’s tutorial on how to use it. Read more »

The web has so many useful services now, many offering their own API that you can draw data from and create your own mashups with. Websites like Twitter, Facebook, Flickr, and Kongregate are just a few.

Their data output is most commonly formatted in RSS (for feed readers), and JSON (a lighter form than XML used a lot for AJAX). In this post I’ll show you how to use the cURL library to collect data from any public web page. Read more »

For those that don’t know, the Google AJAX Feed API is a JavaScript tool that you can use to handle your AJAX requests, and is particularly useful for reading in feed data from external websites. After searching for all kinds of plug-ins and tools, I landed on Google’s answer, and found exactly what I needed – a JavaScript-only feed parsing script.

This tutorial will provide you with a very basic script to start using this great tool and covers what you need to get started.

Read more »

Just a quick demonstration today on using JavaScript and CSS techniques to create scrolling backgrounds. Here we layer backgrounds on top of each other and change their horizontal position to move them past the viewing area. It also uses different multipliers to move the closer objects quicker, and create a parallax effect.

Read more »

When opening new windows from your web page that link to external files, a common practice is to open them in a new window as not to deter the user from your site.

One method to do this in the past was to use target="_blank" that tells the browser to open the link’s href attribute in a new window. This, however, is deprecated in the Strict Doctype of W3C web standards so we should be trying to avoid using it whenever we can, and in this post I’ll show you exactly how it’s done.

Read more »

In the below examples I’ll use data from a fictional database table named “users”. We’re looking to return the 10 most recently added users with a date of birth later than January 1st 1970.
Read more »