Where to put my php file?

I am trying to make an account in android and I am using mysql database to store data. In all the examples I saw, the http message is sent to the IP address and then it finds the php file. Can I just put the php file somewhere in the Android application folder and access it from there, or do I need to find a host for it?

+7
javascript android database php mysql
source share
2 answers

PHP code, especially for tasks such as registering , should never be hosted on the client side or embedded in the front-end application, but instead hosted on the server side, hidden from the user, for the security of your database / application. If you only plan to host your php with your Android application for the case, you need to test it and, ultimately, not have access to the server, then you can consider using the Google App Engine , since it allows you to emulate the server locally without the need for a server . Here you will find information about Amazon RDS .

You can put php in the same directory where you put your index.html file, i.e. in the root public folder of your domain. To upload it to Amazon, you can use cPanel or Filezilla or any other panel you want, among the options available to Amazon for its users.

In the event that Amazon does not provide a place to host your php, you can get a host that offers you static IP access to it, a carefully remembered URL for free . This is very useful especially for testing. However, if you decide at some point to register a personalized domain name, there are other good options for comparison.

+3
source share

You do not need jQuery , when executing a POST request, PHP connects to the database, receives the data and returns it to your application.

So, to answer your question, you have to put PHP on the same server where mysql is running.

+1
source share

All Articles