Hello ... sorry, I'm not Russian, I can make grammar mistakes.

Here is the question: I created a website on localhost, an e-shop. I want there to be an online chat with the admin. If the admin is online, a window will open (well, this is not very important). I just need a principle algorithm and where to find? Is it possible to implement this on localhost? Or is it better to do all this on a hosting?

Thanks in advance, I will wait for help.

    1 answer 1

    Do you have a table online? Or somewhere where the last administrator connection is tracked? If so, you can do so.

    <? $time = time() $sql= mysql_query("select id,last from users where id=[id admina]") // или сразу в запросе, где where можно поставить условие if(($time-$sql['last']) < 900){ // тут скрипт чата } ?> 

    About the query: where last is a column in the user table. Maybe you call it differently or not at all. This is me, an example.