Web Development
Web Development RSS feed-
PayPal IPN with PHP
How To Implement an Instant Payment Notification listener script in PHP
Using PayPal's Instant Payment Notification (IPN) service can be a little complex and difficult to troubleshoot to developers new to PayPal. In this post I will walk you through the entire process using the PHP-PayPal-IPN project to avoid many of the common pitfalls in the back-end PHP code.
-
AJAX Form Submission in Django
Here is a simple example of using the jQuery javascript framework to hijack and submit a Django form using AJAX. Using unobtrusive javascript to hijack the form's submit event allows for a progressive enhancement web design strategy. In other words, this form degrades gracefully for users who do not have javascript. Moreover, a minimalistic approach is used for the AJAX code so as not to add too much additional maintenance to the project.
-
PHP 5 MySQL Database Singleton
Today I pushed the source code to a MySQL "singleton pattern" database class into a git repository. This post will explain the history of this code, how it can be used, and how you can help make it better.
I have gotten a lot of feedback on a very old PHP database class I wrote for PHP4 back in 2004. Frankly, this class is flawed in several ways and very much out of date. I've been promising folks that I would post an updated, singleton pattern MySQL database wrapper for years. Here it is.
This is actually 2 PHP 5 classes: MySqlDatabase is the MySQL database singleton and MySqlResultSet is an iterable object representing a MySQL result set. I had meant to do more work on these classes, but, I simply have too much on my plate. So I've put them on GitHub so that you can use what I've finished thus far and if you want to, you can fork the project and make it better.
Get the code from the git repository
-
Django Authentication using an Email Address
The Django authentication system provided in django.contrib.auth requires the end user to authenticate themselves using a username and password. However, it is often desireable to allow users to log in using an email address rather than a username. There are a few different ways to accomplish this and a lot of discussion on the topic.
In this approach, I use a custom authentication backend to authenticate a user based on his or her email address, I hide the username from the end user, I generate a random username for the user when creating an account, and I manually add a unique index to the email column in the database (this is a bit of a "hack" and I'd love to hear suggestions in the comments).
-
Django Dynamically Generated Images with Cairo
It is fairly simple to dynamically generate images in your Django views using the Cairo 2D graphics library. The simple example generates an image "on-the-fly" in a Django view.



