Tell me more ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'll try to explain what I want as clear as possible and if there are some things that are unclear please let me know.

I've built a live chat using PHP and MySQL (It's a chat program where when you enter your name and hit submit you immediately are taken to the page where other members are chatting.

So by saying live chat I mean a type of program when you enter a message and hit "send" all other members will see it almost instantly. Like skype's text chat. I think you already got the idea ).

So as I already told you I built it AND applied Db class for the MySQL CRUD. It was a bit procedural. So now I am going to adjust it to be fully OO and most importantly apply MVC. In the project to be honest I kinda applied MVC but it didn't satisfy the person who has given me this task.

So I am given to do this task in this way. Whatever happens to the page (I mean a person just enters my website OR sends a message OR has entered a username to enter the chat OR I am retreiving the new messages via setTimeout() (Please I know that there are some bandwith related problems but its ok I am supposed to go with this function and please I dont need you to suggest a better way of solving the problem related to new messages output) ) via GET method I will come to the index.php page (where I have Front_Controller.php instantiated) I will choose which controller to use: for retreiving new messages , for inserting new message ,for inserting the username and outputing the messagesfrom the database.

One of many resaons that still make me feel that I am undone with that project is because I still have some doubts about javascript beeing a VIEW in MVC.
Please you would do me a favour suggesting me to post the code for the livechat that I have done and taking a look at that bloody JavaScript part. So that was the way I handled it.

So my problem is that I am requested to do that this way. So I need to get 2 values from index.php: $_GET["controller"] and $_GET["action"] (action=view).

So please could you suggest any method that I can accomplish this just getting two values in the index.php file? I dont need you write the whole code just need you to put me on the right path.

And please could you explain to me how basically squeeze that bloody JavaScript in your views?

share|improve this question
Please format better your message. – Aurelio De Rosa Dec 4 '11 at 17:20
This question, in its present form, is too broad. Please consider a review of established AJAX chat patterns and, if you have questions about implementation, inquire at StackOverflow for issues with PHP and Javascript. – danlefree Dec 5 '11 at 9:39

closed as not constructive by danlefree Dec 5 '11 at 9:40

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

Browse other questions tagged or ask your own question.