HomePHP Page 5 - Client Management for a PHP Invoicing System
Adding a new client - PHP
What's an invoicing system that can't manage the data for the clients you're invoicing? This article, the third of four parts, shows how to make managing your clients easy. This part of the system allows you to view a full list of client names, and add, update or remove clients from your database.
Once the form is submitted, the following code handles the form data:
<? include "FCKeditor/fckeditor.php"; include "config.php"; if(isset($_POST['submit'])){ $query_ins = "INSERT INTO client SET name='".trim(addslashes ($_POST['name']))."',address='".trim(addslashes($_POST ['address']))."',"; $query_ins .= "date_added = '".$td."',email = '".trim(addslashes ($_POST['email']))."',"; $query_ins .= "contact_name = '".trim(addslashes($_POST ['contact_name']))."',phone_no = '".trim(addslashes($_POST ['phone']))."'"; if(mysql_query($query_ins)){ header("location:allclients.php"); }else{ echo mysql_error(); } } ?>
All that the code above does is match the form data to the table fields and send it to the database, after which the user is sent back to the allclients page.
Conclusion
Client management is the third in the series on creating a invoicing system. The system makes managing your clients easy by allowing you to view a full list of client names and also allowing you to update or remove clients from your database.