AI Zone Admin Forum Add your forum

NEWS: survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Examplebot knows your name

Now when you login to, it knows your name from your login.

There is a chatbot module that replaces the forum module.
However, all the other phpBB forum features remain.
There is a login, registration, private messages, member list
and a user control panel.  It is a unique chatbot experience.

I needed a firewall, so I decided to put the chatbot script
behind a forum package so that I could privately demostrate it,
and make it strong enough to eventually be a support site for the book
chapter being edited by Dr. Diana Perez-Marin and
Dr. Ismael Pascual-Nieto, Universidad Rey Juan Carlos,
Universidad Autonoma de Madrid, Spain

Unfortunately, its potential as a hands-on chapter with working source code and support site was not realized, and its short elegant chatbot source code listing written in pure php was not published as a chapter.

I intentionally wrote it a certain way for the students.  I kept it basic, but included advanced techniques in the design. So I may still try to publish it,  perhaps as a magazine article.  As a last resort, I could easily publish it as a forum modification at, or perhaps a self published book on Amazon.


  [ # 1 ]

Can I use my old account that I’ve created on your other websites? If so, I forgot the URL of the other websites, and I can’t find it my notes, thus I can’t find my account credentials for your site in my records.


  [ # 2 ]

Yes you can.  You can do whatever you like and I will gladly help you.

However, I noticed we only have a few members at,
since initially it began as a private firewall site for an international demo.

So you have the option to register as a new member at
which is unique compared to the other websites.

examplebot requires a login to use, sort of like a social network.
This makes a lot of cool information available to examplebot, such as your
login name, (you don’t have to use your real name) and the last time you logged in, etc.

There is a memberlist once you login, and you know which members are online. You are able to send private messages to other members, and you have your own user control panel.  However there is no forum.  Examplebot is the center of attention.


  [ # 3 ]

registered, waiting for your approval..


  [ # 4 ]

Oh that’s wonderful, Erwin.  Welcome!  I just activated your account.

Please keep in mind, this examplebot script was written according to a specification for the book in terms of the number of pages the source code listing was allowed to be.  Had this source code listing been too long, then it would have been published in the back of the book in the appendix.  So I managed to keep the source code listing short, so it would be published in the chapter, while featuring advanced techniques for the maximum benefit of the students.  For example, it writes its own Javascript program code to keep the last thing you said in its memory.

The phpBB forum package is open source, so modifying it this way is perfectly allowed.  The examplebot source code listing is stand alone, and does not depend on the forum package at all.  Yet the phpBB platform is a good, solid solution to demonstrate the examplebot over the web to the entire university of students.  Many students could login at once, and the phpBB platform would easily handle many multiple members.


  [ # 5 ]

It’s a nice bot. Just 1 little thing about the interface: when I pressed enter, the input got lost, I had to press the button to get a response, which confused me a bit at the beginning.


  [ # 6 ]

Thank you Jan for your excellent, useful feedback!

I just got the same exact results as you, while I was using IE.

The reason I may not have noticed that, is because it works properly in Firefox.

I’ll tweak cross browser compatibility next, because most people use IE.

On the server side I made a quick and dirty IE workaround to save the Stimulus to an input buffer link upon Enter.  Then the input buffer link can be clicked to restore the input box to send to examplebot using the button.  I may change this to client side code shortly, but at least now the input is not being lost when Enter is pressed.


  [ # 7 ]

Here is the standard client side method that submits when you press ENTER.

I may go with this option, if I change my mind about the server side method.

A new problem with this client side method is that Firefox loses focus.

So I tweaked the DOM to make Firefox focus and now that does not work in IE.

This cross browser compatibility is making me dizzy.

UPDATE: (Solved)

I just switched from INPUT to TEXTAREA which eliminates losing the input upon pressing ENTER. This simple solution does the trick.  I plan to improve the style sheet next.


  [ # 8 ]

The title “examplebot knows your name” means that once you login, and/or once dozens of other members login simultaneously, examplebot automatically reads user authentication to know each member by their login name.  So, for example, if your login name happes to be Erwin, examplebot calls you “Erwin” without being told your name directly.

By comparison, other chatbots may, either ask the user for their name, and perhaps only temporarily remember it, or the chatbot may call the user an anonymous name such as, “Seeker” or “Human”... Not that there is anything wrong with either of these techniques.  These are options for examplebot too, running as a stand-alone.  The phpBB platform is the most widely used open source bulletin board in the world, which allows examplebot to provide a much higher level of security and privacy for its logged in users. 

Designed with a basic robot brain, the examplebot source code listing is concise, suitable for print in a chapter of a book, or as a magazine article.  Readers learn the basics of this type of A.I. without having to read hundreds of lines of source code, and thousands of records in a database, commonly found in competition level bots.  Installation of examplebot is extremely simple for beginners.  There is zero configuration. Just upload examplebot to a webserver and its working. By making simple modifications to the source code listing, the Artificial Intelligence of examplebot may be increased.

Erwin, in your expert opinion, may I please ask if you know of any pure PHP chatbot, flat file without a MySQL or other database?  I have not been able to find a single pure PHP chatbot for download on the web.  So perhaps self publishing a book on Amazon would be useful.  However, I would love to get published in a tech magazine like, for example, Wired.

Lastly, thank you… Thank you… Thank you… For your precious support and feedback!


  login or register to react