dpnru86024 2011-03-13 11:59
浏览 27
已采纳

维护活动用户列表并在webhost上检索它

first - I'm absolute beginner with web back-end stuff!

I'm looking for the most simple way to achieve the following:

  1. on the web-host: maintain a user list (doesn't have to be persistent, if the server is rebooted)

  2. allow a client to add it's name to the user list

  3. allow a client to receive the user list

my clients are flash-players but this doesn't really matter. if my web-host would support running servlets, i would create a simple java socket-server - but my web-host allows only PHP and MySQL databases.

Is it possible to do this with php only without the use of a MySQL database?

  • 写回答

1条回答 默认 最新

  • doulai6469 2011-03-13 12:18
    关注

    If the webhost has ACP installed, you can use it to keep the list in memory between page invocations:

    apc_store("userlist", new ArrayObject($active_user_list), $ttl);
    
    
    $temp = apc_get("userlist");
    if (isset($temp) && $temp !== false) {
        return $temp->getArrayCopy();
    }
    return null;
    

    If no PHP cache is not installed, you will need to write the user list to a mysql table.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作