Hii folks i am having one question please don't mark this post as spam .I am just beginner in web services and need of a chat application on ios app .
I am using cake php for web services. i just want to know the keywords i mean how can i search for this topic i am having some keywords like socket and comet to built chat services .
please guide me just want to know how we can implement this not coding just hint me then i will Google for this .Also please tell me which one would be best because in my app while chat a user can send 10 sec video
Hey as Nishant says you have two option of REST and SOCKETS .
But problems arise in both ajax and sockets.
If you want to use sockets than PHP is not suitable for that , I suggest to use socket.io with Node.js or Erlang or Akka with Java or Scala and else if you want to use REST than you can try MySQL + PHP + JavaScript.
I can give you a short rough example of REST with JQuery:-
var lstmsg; window.onload=loadchat();function loadchat(){$.post('newmsg.php?lstmsg='+lstmsg,'xml',function(xml){/* here will be the code to handel ajax*/}); setTimeout('loadchat()',5000);}
yeah.. if you want to create a chat application than there are two main options, one is socket programming and another is ajax.....
here is a link for example of socket programming using php
http://www.codeproject.com/Tips/418814/Socket-Programming-in-PHP
but it is little complicate to understand.
I will suggest you to use ajax rather than sockets..
Related
Most of my website is PHP, and I want to start making a little better UI with live push notifications. I read a few articles and posts here as well, but non provide concrete examples. It's really hard to learn by yourself especially when Node still has no tutorials in abundance, mostly beginner's tutorials.
Let's say I have a PHP page: post.php which allow user to enter a post, and I use PDO to insert that post to the MySQL db.
What is the simple way to connect a node.js (on a different port) and listen to that PHP page, to then in turn show a notification on the navbar, for example?
I know I will need to use socket.io as well.
I'm tried to implementing a live notification which is like the facebook newsticker and the notifications(on top). I was wondering what's the good solution to archieve this. I implemented an chat application before which I fired AJAX GET request in certain time to archieve the realtime, but it seems not good. I checked facebook using firebug, there is no GET request fired(or it is hided?)
Now here is my scenarion:
In main.php
I have a live ticker and a notifications button.
In bulletion.php and User.php
When I perform an add user,it will go heading to the bulletin or user.php.
How can I get informed in main.php when bulletin.php,user.php successfully created in database?
I checked this question as well before I asked.
notification system in PHP/jQuery
Realtime and php?
I was wonder,what's is long poling Ajax and session-based notification.How it can be archieved? I know Node.js can be good in implementing realtime, can it combine with PHP? and memcached ?
Any can provide sources to refer or example might be good.Thank you.
As a side note, PHP isn't really the best language to use when it comes to push notifications, it's really built around typical get/response kinda flows.
I use PHP for all my page stuff, but when it comes to push notifications of any sort I really like http://www.nodejs.org/ and http://socket.io/ to go with it. They're very easy to get setup, and will play well with you using php for the majority of your work, then using node to deal with push notification kinda stuff.
Have you thought about using HTML5 WebSockets? Have a look at EventSockets and the kickstart project on Github.
I've had much success with the server-sent events standard. It's very simple and works perfectly but it's only supported in modern browsers.
Meteor is a comet server using PHP and JavaScript to push data to browsers. It's very slick and worth a look, although it may be a little hard to setup/implement.
Edit: Quick demo here
If i want to create a website containing a game like billiards designed using actionscript 3.0, can i achieve this using php, mySQL, and AJAX? I need it to have real time updates e.g: when one player shoots the ball the other player sees it moving as well as chatting capabilities etc. Im not asking HOW to do it obviously, im only asking what language i should design the website in given that i have a flash game and want to launch it as p2p.
I have very little knowledge of building web applications and i would just like to know if i am on the right track.
Thank you.
can i achieve this using php, mySQL, and AJAX?
Yes, you can.
Look at this article: http://coding.smashingmagazine.com/2012/05/09/building-real-time-commenting-system/
But I would use node.js with socket.io for realtime communication.
I am looking for a solution for PHP and comet. I would like to make a chat using Ajax to send the message. I call the function using jQuery and send data, it is simple.
But the problem is in retrieving new messages. How to retrieve messages using the new solution comet? I need a simple example.
I am looking for a solution for non-commercial use - for free.
In short, I would tell you to use Node.js as your backend technology.
Here's a more lengthy explanation: Creating a live checkers-like web app with PHP, JS, CSS and HTML?
if you're set on using php, you can use a comet server which will sit on top of apache (or whatever server you prefer) and proxy any non-comet requests to it. I've used one called streamhub which is written in java.
Is it possible to implement a JavaScript plugin/app in a web text based game? if it is, how is this done. I don't really need the codes. All I want is the functionality. Basically, I want a player in the game to talk to another player in the same game. Like if he(player) enters a room, I want him to see a player and communicate with him or her. Remember, it is chatting with another player, not another user.
Also, I want the php code used to integrate this app onto the site.
WebSockets are part of HTML5 and fit in my webbased game just neatly. There is a full guide on http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/
you can use long polling with js/jquery ajax calls to the php scripts and the database (or files) to make a chat like program
Try searching for some open/free libraries that you can integrate with your game if you don't want to spend time implementing the chat part yourself. I just found this - https://blueimp.net/ajax/ but I have not used it, so you may want to take a look at the features and if it works for you.