Search code examples
phpmysqlformsfacebook-apps

Save form data from another server


I have simple Facebook app done right now (HTML+JS). User can just click and see some pages/products there but now I would like to add also form where they can leave their information (name + email). The app is currently hosted on my web partner server and I would like to still keep it there but where the information would be saved in future would be on different server. Now I'm worried about the security side. What is the best way to send the form data to another server php, process there and save it db? If this is even possible (should be). I'm more designer guy so I feel bit uncertain when comes PHP and personal information.

So make it short: Facebook app (HTML+JS) that is hosted on Server1. Server2 where I have database and where I would like to save the form data. Or would it be just easiest to move the whole app to server2 too?


Solution

  • You can use PHP on your first Server to write the data into your database on your second Server (using the correct connection). Then when you move your Website to the second server all your data will already be there and you wont need to move anything. If your second server is not yet available you can write the data to a database on your first server. Then when you want to move it to your second server you can export the database from your first server and import it on your second server. Then you will have to change your php to connect to the database on your second server.