Home arrow PHP arrow 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.

  1. Client Management for a PHP Invoicing System
  2. Building a table
  3. Deleting clients and viewing their details
  4. Updating client information
  5. Adding a new client
By: Leidago
Rating: starstarstarstarstar / 15
September 20, 2006

print this article



To add a new client, I created a form that takes the following information:

  • Client name
  • Address
  • Email
  • Phone number
  • Contact Name

Below is a screen shot of what the form looks like.

Here's the HTML for the form:

<table width="100%" border="0" cellspacing="1" class="block">
             <table width="100%" height="19" border="0">
            <tr class="heading">
              <td><a href="Main.php" class="link">[MENU]</a></td>
              <td><a href="logout.php"

          <td height="34" colspan="2">
            <form  name="newc" action="NewClient.php"
<table width="100%" border="0">
    <td><? if(isset($msg)){ echo $msg;}?></td>
    <td width="122"><span class="style1"> Company Name
    <td width="426"><input name="name" type="text" id="name"
$sBasePath = 'FCKeditor/' ;
$oFCKeditor = new FCKeditor('address') ;
$oFCKeditor->BasePath         = $sBasePath ;
//$oFCKeditor->Value             = 'This is some <strong>sample
text</strong>. You are using <a
href="http://www.fckeditor.net/">FCKeditor</a>.' ;
$oFCKeditor->Create() ;
    <td><input name="email" type="text" size="90"></td>
    <td><input name="phone" type="text" size="90"></td>
    <td>Contact name </td>
    <td><input name="contact_name" type="text" id="contact_name"
    <td colspan="2"><div align="center" class="style1">
      <input name="submit" type="submit" id="submit"
value="Submit New Client">


Once the form is submitted, the following code handles the form data:

<? include "FCKeditor/fckeditor.php";
include "config.php";
$query_ins = "INSERT INTO client SET name='".trim(addslashes
$query_ins .= "date_added = '".$td."',email = '".trim(addslashes
$query_ins .= "contact_name = '".trim(addslashes($_POST
['contact_name']))."',phone_no = '".trim(addslashes($_POST
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.


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. 

>>> More PHP Articles          >>> More By Leidago

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: