简体   繁体   中英

Codeigniter Real Time Notifications under Shared Hosting

I have tried to google but all i find related to these topics are nodejs and socket.io

which is fine. but problem i am facing is nodejs does not work in shared hosting.

I want to know any way i can have real time notifications in Codeigniter while i can still use shared hosting services. I Don't have much budget to go for VPS. i want to do it for learning purposes right now.

I have seen Ratchet but still could not find any documentation for it to use with Codeigniter.

-=-=-=-=-=

UPDATE :

I don't know how, but someone made it possible to use nodejs on shared hosting with PHP.. I have not yet tried it, but gonna try it now :)

feels promising as there is a demo too of it.

Kinda of a library. https://github.com/niutech/node.php

Demo Link: http://juvenia.info/node_modules/jt-js-sample/

I had something similar to know for a project, I found a simple solution: Ajax (Jquery Ajax). You can make ajax requests at regular interval.

A specific scenario would be notification of messages in inbox. Right now, i have 2 new messages in my inbox. Every 4 seconds, i make an ajax call. There i check if there is a new message. If yes, it would be 3 new messages. I return two values: number of messages, isChanged.

Using jquery, if isChanged is true, i update the html, else, i do nothing.

This is just a simple scenario to show you how ajax can be used for notifications.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM