-3

I have a question.. I made a kind of social network, but I would like the nofitications appear automatically instead of reloading the page. And even with my chat, because I also have to give reload the page before I get a message from another user.

See my website, maybe you will understand it better.

www.pokay.net

login: demo

password: demo

And sorry for my bad English!

Code:

https://i.stack.imgur.com/5MTnJ.jpg

Torriva
  • 7
  • 1
  • First google it, try it yourself and if you face any problem then come here. – Al Amin Chayan Sep 06 '15 at 10:30
  • True, and here are some additional hints: such thing requires client side code, so javascript. This cannot be done by server side code only which is all php can provide. – arkascha Sep 06 '15 at 10:31
  • You need js/ajax, BUT...you will need a little more in this case. Useful topic: http://stackoverflow.com/questions/1577469/ajax-chat-polling-bandwidth-efficiency – sinisake Sep 06 '15 at 10:40
  • Server Sent Events may be a good way for that. – Ahmad Sep 06 '15 at 11:19
  • Please don't use any external links, they often are broken, just like this one. – Sam Mar 14 '19 at 13:42

1 Answers1

0

You can look into websockets. I think it will provide you with the solution.

Chris
  • 987
  • 6
  • 24
  • What would you suggest? I write a websocket example (which there are a ton of on the internet) and give a short tutorial in this little text window? How about you give an answer instead of commenting negative comments? – Chris Sep 06 '15 at 10:38
  • You could for example have referenced such examples, specifically one that really matches the OPs question. Or given a general example yourself. Just dumping some word is not enough for an answer, sorry. I agree that it is not really possible to answer to the question in a meaningful way. Which is why I don't. I wrote a comment to the question instead with my hint. In general it is a good idea only to post an answer if one can really provide a good and precise answer and to not answer if one can only offer a general hint, but place that as a comment instead. Thanks. – arkascha Sep 06 '15 at 10:42