php live chat application algorithm
Below is what i understand how a live chat application can be created.
Please make any changes and revert.
Work Flow
1. Visitor logs in to chat, providing name and email id
2. create sessions for loggedin users
3. Welcome note send to visitor.
4. Visitor initiates chat ('hi','hello')
5. admin reply to chat.
Backend process
1. admin can view all logged in users
2. text sent by visitor via visitor chat panel will be visible at admin chat panel.
3. Admin reply ('hi') should be sent to that particular user only.
Database (please updated DB i made it as per my understanding)
Visitor table
v_id
v_name
v_text
v_texttime (at what time the text was sent)
v_conversation (updated complete conversation )
v_status
admin table
a_id
a_name
will i require IP address of visitor, if yes then please let me know what data type i must use for it. As well as how i can use the visitor IP address in this application.
I will require to program in ajax (correct me if i am wrong )as only that program (live chat) will need to access the php script each time text is sent.
Please let me know the basic syntax of ajax, i need to create a very simple chat application.
Thank you in advance.
