A little bit of everything…
RSS icon Home icon
  • AJAX add content to favourites script

    It has been a while since I last wrote a post but, as I said, I’d be back again! Not that I have much free time, but I’ll keep posting stuff whenever I’m inspired and have the time to do so :)

    Today’s post is a response to deepali’s comment here. There are lots of ways to achieve the result, and this is just my approach to the issue. The following script allows users to favourite/unfavourite posts, pictures, etc. with AJAX, PHP and MySQL, without reloading the whole page. A clear example of that is Youtube.com, where users can add videos to their favourites with just one mouse click and without reloading the whole content of the page.

    Read the rest of this entry »

  • Checking availability of user name with AJAX

    AJAX

    Lately I’ve been writing quite much about AJAX, but it is so useful that I’m sure it is of everyone’s interest!

    In this post I will show you – as the post title says – an example script of AJAXed registration form, without recurring to AJAX frameworks (there are already many tutorials about this topic in relation with them). The example omits the synchronous part of the registration and focuses on the user name, which we want to asynchronously check. It doesn’t sound so weird if I say it in other words: check on the fly if the user name the person is typing already exists in the database or not, and take actions depending on whether it does or not (for instance, only allow form submission if name is available).

    This is the basis for other types of effects like for instance searching contents and dynamically returning result suggestions, or checking if a specific word exists in the database, etc. but as I mentioned, here the intention is to use it on a registration form.

    Read the rest of this entry »