Hi, I am trying to use chatter bot (hosted on pandorabots.com) on my site.
but instead of using IFrame I want to access the API using PHP.
pandorabots provide API
here is quote from the site
=================== QUOTE ==========================
A client can interact with a Pandorabot by POST'ing to:
The form variables the client needs to POST are:
* botid - see H.1 above.
* input - what you want said to the bot.
* custid - an ID to track the conversation with a particular customer. This variable is optional. If you don't send a value Pandorabots will return a custid attribute value in the <result> element of the returned XML. Use this in subsequent POST's to continue a conversation.
This will give a text/xml response. For example:
<result status="0" botid="c49b63239e34d1d5" custid="d2228e2eee12d255">
The <input> and <that> elements are named after the corresponding AIML elements for bot input and last response. If there is an error, status will be non-zero and there will be a human readable <message> element included describing the error. For example:
<result status="1" custid="d2228e2eee12d255">
Note that the values POST'd need to be form-urlencoded.
=================== END QUOTE ==========================
I have created html form that connect to my bot ans POSTs the input
<INPUT id="botid" name="botid" type="hidden" value="e35f2c157e362d3e" />
<INPUT style="WIDTH: 160px; " type="text" size="21" id="input" name="input" value ="">
<INPUT id="Submit1" type="submit" value="Submit" name="Submit1">
Now I need to create one php file that will simulate chat i.e. capable to reseive the response from the bot and show it to user
Any ideas how to do it? I mostly need advice on how to capture the response - I will handle xml parsing and output by myself