【问题标题】:online offline and offline synchronization in phpphp中的在线离线和离线同步
【发布时间】:2013-01-21 06:23:03
【问题描述】:

我想在我的 php 页面中创建一个按钮,它可以将数据库从 localhost 同步和更新到服务器和服务器到 localhost。本地主机拥有自己的用户 ID 和密码。我的意思是,如果互联网不工作,他们可以离线更新他们的数据库,当有互联网时,他们可以在服务器中更新他们的数据库,同时从服务器更新的数据库也应该在 localhost 中更新。

【问题讨论】:

  • 在线离线和离线同步?你的标题让我很困惑。

标签: php tags


【解决方案1】:

您应该在浏览器离线时尝试使用localStorage

  1. http://diveintohtml5.info/storage.html
  2. http://www.w3schools.com/html/html5_webstorage.asp

然后你应该在你的浏览器再次建立 Internet 连接后使用 AJAX,这样你就可以将localStorage 内容发送到你的服务器:

  1. http://api.jquery.com/jQuery.ajax/
  2. Sending localStorage variables through the jQuery Ajax function without it being in the url
  3. http://www.w3schools.com/ajax/default.ASP

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-27
    • 2010-09-21
    • 2011-09-10
    相关资源
    最近更新 更多