Let's wrap up what we have learn in the first set of tutorials by building a polling application! This is given to you as an exercise.

But in case of need, you can download the full application package for reference. The package includes the client library, all the source files and image file used to build the application. Besides, SQL scripts for creating the database table is given to you also.

Note that before downloading starts, you need to complete a survey provided by CPALead.

Sorry that I won't accept email asking for a copy of it. If you have difficulties in completing the surveys or do not want to do that, you can consider subscribing to our mailing list service. For USD29.99 per year, any eBook and free demo application source code packages published here will be sent to you. Payment can be made via PayPa (my paypal account is takwing@graduate.hku.hk). For details, please send email to takwing1hk@yahoo.com.hk.

Polling Application Package


Application Flow and Sample Screens

In the polling application, the index.php (which is the "Polling Results" page) shown below is used as the welcome page. The current polling results (which are calculated from the database records) are also shown here.


Clicking the "I want to Vote!" tab should lead us to another page where we can cast our vote.

At this moment, we would expect the user to be a Facebook user with appropriate permission granted to us already. If not, our application should be able to handle this by displaying the appropriate dialog box as shown below:

With the necessary permission granted, the voting page is shown:


After casting the vote, a post would be posted to the user's wall as shown below:

Besides, the following invitation page would be displayed:


Using the Application Package

If you would like to use the application package for testing purpose, before uploading the files to your web application server, please note the followings:


I hope you will find the tutorial useful!! And in case you have any problem in completing the exercise, send me an email.

You can test drive this polling application by visiting here.