chat rooms implementation [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Can you give me an idea on how to implement chat room using PHP and MySQL?

You will probably want to use AJAX or if not that, Javascript with timer to make chat appear instant or with polled updates.
(Chat text data fetched and displayed.) Form frontend fields accepts chat input
Chat input sent to server via form. AJAX waits to receive data to update chat text display.
Server updates a data queue (example - PHP dumps to MySQL). Data sent back to frontend via AJAX wrappers
Repeat
There are lots of tutorials on creating something like this - including a number with AJAX i/o - http://css-tricks.com/chat2/

The best you can do with php and mysql is create a bulletin board kind of system where people add comments to a "channel", then reload the page to update.

In general, I think, it is a bad idea to use PHP for this kind of project. Every client hast to reload the page (mentioned bulletin board e. g.) every few seconds to get informed about updates.

If you want to code in PHP and a little javascript, try Jaxl library Web Chat sample application. Can be worked upon to build a full fledged chat systems. http://github.com/abhinavsingh/JAXL. XMPP protocol is the way today, when it comes to chat client :D

Related

How to receive notification in android if a data is inserted in the database [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a mySQL database, and I created a simple android app that can display the data from the database using json. And I want to add the function wherein if a data is inserted in my database, the android app will be notified.
For example.I have two android app(App "A" and "B"). App "A" can Insert Data, and "B" can Display the data. I'm thinking of, everytime that App "A" Inserts a data, App "B" will be notified, and can refresh the current displayed data. I am thinking of refresh the list every certain time(5-10sec), but it seems to add more process time, and I think maybe refreshing it only when a data is inserted in the database would be better. Is there a way to do this? Hope that you can provide me some knowledge on how to do this. And if possible some example codes. Thank you.
So if your backend is built using php, this is possible. I assumed that because you've set PHP as a tag.
Every time someone request to insert data to your php, you can insert it into MySQL and if insert went OK you could Google Cloud Messaging (GCM): https://developers.google.com/cloud-messaging/
Read documentation well, because GCM is not one-liner. It requires setup on Google console, your PHP server and Android app.

PHP and SQL basic instant messaging [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am thinking of creating a simple web based instant messaging using a combination of PHP and SQL. To keep it simple I was thinking of not sending the message to the other clients browser using COMET or AJAX, but simply uploading it to a SQL database. The other clients computer will then periodically refresh the webpage which will cause the PHP code on the server to check for and return any new messages.
Would this method be simply to slow to be actually useful?
Thanks in advance :)
That depends on the scope of your project. If you're thinking of server a thousand users, this is not a recommended method. If you want to chat with your 5 colleagues on an internal LAN: it doesn't really matter much. It will be fast and work just fine.
You could also consider building it with jQuery + PHP + SQL though; read up on jQuery a bit and you'll be amazed by the power of its AJAX functions.
Also, if you're lazy or simple don't have enough time, use a premade library like this one here and i'm sure there are many more to be found on the internet.

How can I display dual screens in PHP web applicatoin [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a POS software developed in PHP and running as a web application.
I need to have dual monitors, one facing the employee with full details (sales screens showing heaps of options) and another monitor facing the customer with summarized information (ex. item, price list only)
How can that be achieved?
Many thanks
Because your dealing with the web, event driven development is not going to be possible. So to get around this, you will need to have two browser instances (1 per monitor) where the waitress side will need to do an ajax push on each update and the customer end will need to do some kind of ajax polling based on a timer. There is a lot of information all over the internet about how to accomplish this sort of thing. Take a look at Push notification to the client browser for some more discussion on the topic. There are some less supported methods you maybe able to leverage like realtime push notifications or multipart/x-mixed-replace MIME type or Comet or HTML5 Websockets.

how to transffer data from website to android app and enable or disable it from website only? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
My team is going to make application in android having quizzes on mobile whose questions,options would be entered from my website. I want to be able to enable the new quiz from website end.
Going to code website in PHP. I'm good at wordpress so just wondering if I can do this in that only or not as I don't in what form I have to convert my data so that android can get it and use it in "native app"(not browser!!).
my job is only the website part I know how to make pages but don't know in what form I have to give quiz data and how to control enabling and disabling the quiz in mobile app
thanks for the help in advance...
There are several ways you can transfer data through different applications/technology.
Some ways that appear to be straight ahead to me:
The Android App can parse your generated HTML file directly and extract the questions and the options parsing the HTML tags.
The Android App can also connect to your website DB and get the information directly from that.
You can also expose your data creating a services using WebServices or ODATA, for example.
I have to say I've only ever dealt with Cordova for writing apps but if Cordova can do it...
In the app I wrote for an internal application I used an AJAX call (Cordova uses JS + HTML as its interface). My PHP server then returned a response my app could use (in my case, JSON) It sounds like this is what you want to know. Now your app team will have to tell you what format to send your response but it's possible to have apps do this.
This would have to be done in PHP(EDIT: or any other technology as such) since your team is working in PHP already. To enable/disable the "new quiz", the app would have to query the server for this information, which would come from the Database.

Creating a dynamic one page web application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I would like to make a web application (PHP) that will have overlay container that contain dynamic fields/forms.
I would like the user to complete the form but not be taken away from the main part of the page.
Imagine, browsing a website and reporting a page error into an overlay but not being taken away from the page you were reading.
Also, is it possible to make the form multiple parts/pages, such as user clicks next button and the next part of the form is presented?
Nice example of this type of web app here, with some useful tips:
The Future of Web Apps - Single Page Applications
What you are looking for is called ajax.
Using jQuery you could easily create the kind of form you want where the whole page is not reloaded upon submission.
Going into more details, check out jQuery UI. There a set of usually very simple to implement power tools to help create a dynamic webpage.
So jQuery UI stuff for layout (look at tabs) and ajax through jQuery for your communication with the server (PHP).
I just finished building a single-page application using the Yii Framework for PHP and Jquery (Jquery UI as well).
What I have learned is that Jquery isn't adequate enough to handle a true single-page application.
What you need to use is a library that handles a lot of issues that will come up whilst building SPA's and frees you from having to do a lot of DOM based manipulations.
Instead what you'd end up doing is actually write a true application and let the 'library' handle those aspects for you.
One library that comes to mind is AngularJS.
Hope this helps.

Categories