0
votes

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?

1
Why would not just keep the app/code on 1 server and just store it to the database on another server? - Naruto
Some contract/money things just, so that would preferred way. - user995317
If it's non sensitive info. You could handle a form with POST and build a redirect url with GET. Then send it to a different domain or server. If the info is sensitive handle the form save it to a db and then retrieve the data on a different server from the same database. - Rimble
@TomKriek . If the info is sensitive handle the form save it to a db and then retrieve the data on a different server from the same database - Why would you do this? Just make sure you are working secure(SSL). - GuyT
For starters I'd rather not pass around password and pincodes in GET. When working with sensitive data an encryption of some sorts is advised/recommended. Imagine that a friend of yours is using the computer on the same site and types in the url of that site. Then the full link might pop up with GET variables in them. Hence if it's only parameters to determine an action on the next page it would be ok. - Rimble

1 Answers

3
votes

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.