HomePHP Creating a Login Script for a PHP Invoicing System
Creating a Login Script for a PHP Invoicing System
In this first part of "Building an Invoicing System," we are going to look at invoice management. Why would anyone want an online invoicing system? Well, if you are a freelance web developer like myself, you will undoubtedly need to invoice your clients so as to be able to get paid at the end of the month. This application will help you to manage your client details as well as your invoices.
Of course there are a great many invoicing systems out there, but most of them(or at least the good ones) will cost you a lot of money. What you get with this system is:
Client Management: create, update and view client information.
Invoice Management: create, update, view and print invoice data.
User Management: create and keep a log of people using your invoicing system.
Because every person will have different requirements for an invoicing system, I've decided to make this program as general as possible. Of course there are common aspects that everyone will need from a invoicing system, such as the ability to create a new invoice or to create a list of all clients that you work with, among others. These commonalities are adequately covered in this article.
PHP4 or higher: Available from http://www.php.net
MYSQL: Available from http://www.mysql.com
The best way to make invoices printable is to create them in pdf format. This is why we will use the php_pdf.dll extension, available to PHP since PHP version 4. To use this extension please do the following:
First you will need the PDF Acrobat reader/viewer. If you do not have it on your system, please go to: http://www.adobe.com/products/acrobat/ and download Adobe Acrobat. It will not cost you a cent, so go ahead and download it. Then once you've downloaded and installed Acrobat Reader, the next step is to locate the php_ini file that came with your PHP installation. If you are running a Windows system, it should be located in your C:windows directory or in your C:php directory. Open it up in notepad and use the find dialog box:
This should help you find the extensions list fairly quickly. Once you've reached the list, scroll down until you find php_pdf.dll, then remove the semicolon(;) just in front of it. Save and close the file. To make sure that the pdf library is available, open a new document in notepad or any text editor and type the following:
<? phpinfo(); ?>
Save the file as test.php, NOT test.php.txt or anything else. It has to have the .php extension only, otherwise it will not work. Run the script and make sure that you see the following in the resulting page:
As you can see from the screen shot above, it should have pdf enabled.