2uzhan.com
Advertisement
Now Place:2uzhan.com » Real-Time Notification Update in PHP

Real-Time Notification Update in PHP

Web Development @ April 7, 2015   Views:0

I want to implement a website that has different types of users. I want that when a user posts something, the admin will be notified automatically. I have read about WebSockets and found some examples but mostly of them are about chat application. I just want a notification update. I just want to have a simple one.

Hope you can help me with this.

--------------Solutions-------------

Websockets can certainly do that or you could use a Comet server (push). However Comet has its cons. Meteor may be a solution http://meteorserver.org/ but not striclty php.

socket.io has some nice examples too. If I were to implement something like push notifications, I would probably start experimenting with this.

Push notifications are very similar to what goes on in chat apps, so the faact that you see those as the main examles is not surprising.

I really don't have any idea how to implement that one. My main problem is the connection between the admin and a normal user. I want a specific client to be updated as well whenever the admin updates something. I don't want all the logged in user to be notified.

I have read about Comet too but I don't know how to implement it.

Comet does look pretty fiddly to set up. I once tried to implement it from the APE site, but I failed miserably. I'd have a little play with the socket.io version and see how far you get. Then when you hit the wall with regard to user access come back. I'm sure that other people have tried what you're trying and there will be forums and tutorials online. I haven't seaarched for them, but i'd be very very surprised if there aren't any.

I've not been able to find much on socket.io and PHP, so perhaps wesockets would be better:

http://www.websocket.org/demos.html

If you want real help, rather than some opinions on how to approach the problem, then post your code here!

I'm attempting to simplify my fundraising page, and would like to show exactly how much each donation would help us out. I've listed the options below, but I would like ...

I'm currently doing some encoding work to protect a site from XSS attacks. We've stuck a bunch of <script>debugger;</script> tags in the db. Dispite my best efforts, the strings I've ...

    //The php section of the code

           <?php

           function getJSONFromDB($sql){

           $conn = mysqli_connect("localhost", "root", "","rent");

           //echo $sql;

           $result = mysqli_query($conn, $sql)or die(mysqli_error());

           $arr=array();

           while($row = mysqli_fetch_assoc($result)) {

                   $arr[]=$row;

               }

               return json_encode($arr); ...
© 2018 2uzhan.com Contact