Quote of the Day
To me, clowns aren't funny. In fact, they're kind of scary. I've wondered where this started and I think it goes back to the time I went to the circus, and a clown killed my dad.
- Jack Handey (aka Jack Handy)

Phonebook.phpMonday 13th of November 2000 09:54:02 AM
Posted by - Bill Peck

When I first started working at Community Newspapers I quickly learned the programming language Perl. The best way to learn anything is to have a project or goal to accomplish. One of my first goals was to create an online phonebook for the company intranet. This project not only taught me Perl but HTML and SQL.

Before this project I used Perl to do everyday Unix Admin tasks. Since thats what my job actually is. :-) But when you start doing web programming you quickly realize that its different. The whole idea of stateless programming took a while to sink in. Basicly everytime someone accesses a web page they connect, download the content, close the connection, and display. So when you have an application that has thousands of records where you don't want or have the memory to display everything at once you need to deal with it differently than a normal program. For example with the phonebook I wanted to display about 50 records at first and then have the user click to see the next 50. But that user isn't connected anymore so I need to know when they connect again that they want the next 50 and not to start at the begining again. :-)

Its now 4 years later and I'm working directly for Fidelity Capital. One of the capital companies we do work for asked for an online phonebook so I took out the old code and had a look at it (Community Newspapers are still using the original code right now). I thought it was good time to update this aging relic with PHP3 and a MySQL database. Plus I know alot more now. :-)

So I sat down and a couples days of coding spread out over a couple weeks produced a newer sleeker version. (Sounds like a car commercial). The user interface is changed slightly, an annoying bug from the old one prevented you from hitting return after you entered a name in the text search field, thats fixed now. I use javascript popups for paging interface. There is now a built in editor which allows you to, well edit! Assuming you put in the correct admin password. The old system relied on a Microsoft Access front end that used ODBC to connect to Sybase (Can you believe I actually did anything on a Micro$soft system!). It never worked very well, I think it was that the ODBC drivers sucked.

Requirements for this package:

  • PHP
  • MySql - might work with others that phplib support
  • xlHtml - if you want import Excel files

Where to get it.


< Rocket Launcher Back to Index webCam using Firewire... >
  • Phonebook.php3 by Matt Deres Friday 07th of April 2000 09:09:39 PM EST

    Let me be the first to say that this phonebook is AWESOME!!!!!!

    I've seen the "old" version and have benefited from the new and the transformation has been great! The page is very fast and easy to use. Everyone that I've shown it to at work has fallen in love with it straight away! I had the opportunity to show it to someone that is an ASP programmer and they were VERY impressed with the functionality, size of the code and the fact that all the bits (OS, MySQl, PHP) were free!!! Keep up the good work Bill!

  • Phonebook.php3 by Bill Peck Saturday 08th of April 2000 06:17:21 PM EST

    If you get the following error try appending the local.inc that comes with phonebook.php3 to your global local.inc that came with phplib.

    Fatal error: Phonebook_Session is not a class in page.inc on line 18

  • Phonebook-1.1.php3 by Bill Peck Wednesday 17th of May 2000 11:31:04 AM EST

    I have releasled a new version of phonebook.php3. I found that I was using an old version of phplib and it didn't work with the newest 7.2. I fixed that problem and also found some spelling mistakes, database created in CAPS but referenced in lowercase, and a left over include that didn't exist anymore.

    So this should be a much cleaner version. If you emailed me about not being able to get into the admin interface this version should work for you.

    I added a little more to the README which should help people installing.

  • Phonebook 1.2 by Bill Peck Wednesday 28th of June 2000 08:58:08 AM EST

    Version 1.2 is available now..

    List of Changes

    • Seperate Admin screen (deals better with phplib)
    • Import/Export, if xlHTML is installed it will even do excel imports
    • support for international phone numbers

    Still ToDO:

    • Add in custom views
    • More error checking :-)

    • Phonebook 1.2 by Bill Peck Thursday 29th of June 2000 06:49:28 AM EST

      The Schema file (phonebook.sql) was missing the initial create database phonebook; use phonebook;. This has been fixed now.

  • Phonebook.php3 by Stan Rock Monday 14th of August 2000 09:42:02 AM EST

    Has anyone tested this with php4? I've installed in on two boxes and am having different issues on each. Any help would be appreciated.

    • Phonebook.php3 by Bill Peck Tuesday 15th of August 2000 09:12:55 AM EST

      I have installed it with php4. What kind of issues are you having?

      I'm thinking that the next release will include a version of phplib since that seems to be where most people are having problems..

      • Phonebook.php3 by Joe Bloggs Sunday 20th of August 2000 10:12:07 AM EST

        ...that would be good or even a primer on installing phplib would be great.  phplib's documentation isn't great and in the end i just can't get it to work.
        which is quite frustrating, cause i really wanted to use phonebook.php3's functionality.

  • Phonebook Version 1.2.1 by Bill Peck Monday 13th of November 2000 09:45:17 AM EST

    Changes :

    + Included a snapshot of phplib, this also removed the requirement to edit php.ini
    + Fixed a duplicate session id bug in phoneadmin and phonebook_newuser.

  • Phonebook.php by Samantha Davis Monday 09th of July 2001 09:38:44 AM EST

    I love this phonebook! I started to set it up on our intranet and got busy with some other projects. Now I'm back to working on this. The problem is, in the meantime some databases were set up on our system for some other functions on our intranet (ok I'm *trying* desperately to justify using Microsoft UGH) and it turns out that unless I totally duplicate some stuff I will have to use access as my backend database. Can I get a copy of the old program? Or instructions to get the current version working with access?

    This will not need to odbc to another database from access, the data is within access itself. Thanks a lot!

    • Phonebook.php by Bill Peck Monday 09th of July 2001 02:41:40 PM EST

      The old program only used access to administor the data. The data was actually on a sybase database. Even if it did I didn't keep a copy of it.. Sorry..

      What about using ODBC to get to the data?

      • Phonebook.php by Samantha Davis Thursday 19th of July 2001 11:38:00 AM EST

        I dont know how to set up ODBC from this Linux box to the NT server that the access database is on :(

        I guess I can try to install PHP on the NT webserver, do you think the phonebook program will still work if I do that? I could pay you to do any special modifications that would need to be done :)

  • Phonebook.php by Steve McAllister Saturday 06th of October 2001 09:51:56 PM EST

    I have been trying to get this to work for some time and really dig the way it looks, but am not so good with php. More comments in the files would help for us dummies. I know documentation is a big time waste for developers, I'm guilty of this myself, but I think this project rocks! I get the phonebook to work, but the admin page gives this:

    Fatal error: Cannot instantiate non-existent class: phonebook in /home/httpd/phplib/ct_sql.inc on line 32

    This probably has something to do with phplib, but don't know what?

    This project has potential of being very popular and wish I could contribute, but am new to php.

    Thanks steve

    • Phonebook.php by Bill Peck Sunday 07th of October 2001 08:00:45 AM EST

      Thanks for the praise but I'm afraid that this project has been back burnered. I don't work for the company that I wrote it for anymore and I don't have a need to use this on my own so its been neglected..

      If anyone would like to take over this project and make it easier to install then go for it!

      • Phonebook.php by Marco Wednesday 12th of December 2001 08:08:14 PM EST

        Hello Bill,
        I like this neat software and like the others I thank you for taking the time to respond to our issues. I downloaded the software and installed it on my Linux box. It is working but I get this error on the Admin Page:
        MySQL Error: 1062 (Duplicate entry '956dfbc26f526b98e013221397d884fd-Phonebook_Session' for key 1)
        Session halted.
        I have struggled with it without any success. It seems like I read on the comments page that you have release version 1.2.1 that fixed a "Duplicate Key" issue. I don't seem to find this version anywhere. 
        Could you provide me with any insights?
        Thank you again for your time

  • Phonebook.php by James White Wednesday 07th of July 2004 04:52:08 PM EST

    Hi bill,

    I hope this reaches you. Your Phone Book script looks exactly like what our organization needs. I downloaded the two phps files and the tgz file from your page. After looking at the readme, it seems I need a file phonebook.sql to create the database tables in mysql. However I cannot find this file. The tgz file only contains one file named phonebook with no extension. Iím not sure what to do with this file. I opened it with wordpad and it looks like several files all bunched together. Im sure this is some sort of unix thing im not aware of. I'm used to just uploading the php files ect., then running a .sql file in phpmyadmin to create the tables. Any help or advice will be greatly appreciated. jwhite@[nospam]sii.edu

    • Phonebook.php by James White Thursday 08th of July 2004 05:01:31 PM EST

      Ok, got the file figured out. The file with no extension is appearantly a .tar file. I got it all extracted and uploaded. I got my DB and tables created. I edited local.inc with my DB info. However when I point my browser to phonebook.php I get the following error:

      Fatal error: Cannot redeclare gc() in /home/iiacom/public_html/phonebook/phplib/session.inc on line 457

      • Phonebook.php by Bill Peck Sunday 11th of July 2004 08:00:34 AM EST

        Wow.. I haven't used this program in years. I'm glad it might be useful for you but it may be more trouble than its worth now.

        The main problem is that the newest php has its own session support and doesn't seem to work very well with phplib.

        I can get the page to come up but I can't authenticate into the system. Seems to be forgetting the $username and $password variables.

        I just don't have the time right now to really investigate this. I think it would require a rewrite to use php's internal session support.

  • Phonebook.php by George Lagardo Saturday 26th of March 2011 05:27:36 AM EST


    i have xampp server and i donwnloaded this project. as per your instruction created the db but i am unable to run the .php3 files , i have php 5.XX version installed. my normal .php works fine however these .php3 does not work please help what do i do

< Rocket Launcher Back to Index webCam using Firewire... >

This Page has been Accessed

Since 01-18-1999