开发者

Gears and Mysql sync

I am making an offline website that needs to sync every night with a server. Our employees work outside and sometimes underground and need to access the site for its database. But once home they must send us their findings.

The first time they connect, I check with g开发者_如何转开发oogle gears if they have the sqlite database and if not I run a script to insert it. Once they have it, I sync their next appointments to their local database.

When they are done, the next day, they connect to send us every thing and to download their new appointments.

For now i was able to create the sqllite database and insert new values inside thanks to google gears. But i haven t found a way to read the database with php to sync it with our online database.

To go from online to off, with PHP I can write an array in a hidden field and then read that field with JavaScript. But in the other way i was wondering if there was on other way then creating a form with DOM and submitting it in JavaScript to read the values with PHP?

I need to sync a Lot of values, do you know if there is an easier way?

Thanks for your help


I have found vortex, a powerfull script for gear that helps sync everything from files to data. It will definitely help me.

Here is the link to the developer's blog. The download link is in there.

I will come back when the website works to help the interested.


You should use Ajax for posting your new data to the PHP server.

You could use jquery (or any other framework), their lootle of resources how to post data to php on the web.

Your webpage could have a button hidden when offline, this button would enable user to start a synchronization.

Here a tutorial from PHP and jquery!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜