Jump to content

Creating a "chatting bot" using PHP


alekz

Recommended Posts

I'm trying to code a page in which you can "chat" with a selected celebrity.

For example; Someone goes to my page and they click the link to "chat" with Il Divo. Of course they're not really going to chat with any of the members. However, I want to make it to where they ask/comment and they get a LOGICAL response.

I have done this before using Javascript. Using; "var i = Math.floor(Math.random() * 5);". [a href=\"http://itsallaboutplanetkidz.com/sample.htm\" target=\"_blank\"]Here's[/a] an example.

But someone told me it would be easier and more efficent using PHP. They ask a question and upon submitting the DB is searched.

EX.

How are you?

Then get the DB to search for
How (*?) are (*?) you (*?) ?

and generate a logical response.


I don't know if all that made sense. Im pretty much trying to create a type of bot to give out logical responses. Kindda like I did it with Javascript, but much 'smarter.'

Suggestion, help, comments are greatly appreciated it.
Link to comment
https://forums.phpfreaks.com/topic/3727-creating-a-chatting-bot-using-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.