Connect to MySQL via PHP script. Blocking issue?

Hello,

I have an android application which connects to my sub-domain that has a PHP script on it. I can connect and run the PHP script locally through android studio however other users cannot connect to it via the app.

Is there any port or something that is blocked from outside users connecting to it?

Please help, thank you.

@blairr said:
Hello,

I have an android application which connects to my sub-domain that has a PHP script on it. I can connect and run the PHP script locally through android studio however other users cannot connect to it via the app.

Is there any port or something that is blocked from outside users connecting to it?

Please help, thank you.

This is because of the security system to ensure your website is only accessible on real browsers.

Please read the KB article for further information:

@blairr said:
Hello,

I have an android application which connects to my sub-domain that has a PHP script on it. I can connect and run the PHP script locally through android studio however other users cannot connect to it via the app.

Is there any port or something that is blocked from outside users connecting to it?

Please help, thank you.

The problem is created by the security system on free accounts.
Try to use CloudFlare and Full or Flexible (FULL RECCOMENDED) SSL, and when ready try again to access your script through your mobile app.

@UnknownLolz said:

@blairr said:
Hello,

I have an android application which connects to my sub-domain that has a PHP script on it. I can connect and run the PHP script locally through android studio however other users cannot connect to it via the app.

Is there any port or something that is blocked from outside users connecting to it?

Please help, thank you.

This is because of the security system to ensure your website is only accessible on real browsers.

Please read the KB article for further information:
https://infinityfree.net/support/javascript-error-using-api-or-mobile-android-app/

I don’t necessary access the website on the android app, I just do a post method to where my script is. For some reason when I supply a cookie header in the post request it works on my phone but not other phones that aren’t connected to my wifi.

Thanks for the help by the way.

@ChrisPAR said:

@blairr said:
Hello,

I have an android application which connects to my sub-domain that has a PHP script on it. I can connect and run the PHP script locally through android studio however other users cannot connect to it via the app.

Is there any port or something that is blocked from outside users connecting to it?

Please help, thank you.

The problem is created by the security system on free accounts.
Try to use CloudFlare and Full or Flexible (FULL RECCOMENDED) SSL, and when ready try again to access your script through your mobile app.

I see CloudFlare on my portal, do I disable this? Sorry i’m trying to figure this new stuff out.

Thanks.

@blairr said:

@ChrisPAR said:

@blairr said:
Hello,

I have an android application which connects to my sub-domain that has a PHP script on it. I can connect and run the PHP script locally through android studio however other users cannot connect to it via the app.

Is there any port or something that is blocked from outside users connecting to it?

Please help, thank you.

The problem is created by the security system on free accounts.
Try to use CloudFlare and Full or Flexible (FULL RECCOMENDED) SSL, and when ready try again to access your script through your mobile app.

I see CloudFlare on my portal, do I disable this? Sorry i’m trying to figure this new stuff out.

Thanks.

You have to use either CloudFlare from cpanel (EASY WAY) or update nameservers and use it from there (COMPLICATED WAY). You must enable it, go to the Crypto Section of CloudFlare Dashboard and select Full SSL, then wait up to 24 hours for DNS to propagate and SSL to work.

@blairr said:

@UnknownLolz said:

@blairr said:
Hello,

I have an android application which connects to my sub-domain that has a PHP script on it. I can connect and run the PHP script locally through android studio however other users cannot connect to it via the app.

Is there any port or something that is blocked from outside users connecting to it?

Please help, thank you.

This is because of the security system to ensure your website is only accessible on real browsers.

Please read the KB article for further information:
https://infinityfree.net/support/javascript-error-using-api-or-mobile-android-app/

I don’t necessary access the website on the android app, I just do a post method to where my script is. For some reason when I supply a cookie header in the post request it works on my phone but not other phones that aren’t connected to my wifi.

Thanks for the help by the way.

It’s quite simple: the security system works with a Javascript challenge and sets a cookie which is then used to access your website. Of course, if you clone that cookie, you can use it to connect from devices which don’t support Javascript themselves. But the cookie is IP locked and has a limited lifetime, so you can’t just pack it in your app.

What you want just isn’t possible on InfinityFree. This service is for free website hosting, not for a free Android app data storage platform.

Ironically, accessing the website from the Android app would work, even if a simple HTTP call doesn’t. Web Views, as far as I know, can execute Javascript and accept cookies. But using an InfinityFree as a backend API is not possible.