Skip to first unread message
Assigned to taifu...@gmail.com by chrisw...@gmail.com

Dr. Sohil Harsoda

unread,
Jul 1, 2018, 4:48:07 AM7/1/18
to MIT App Inventor Forum
Hello,

I have tried to connect app to mysql database using php script as per https://puravidaapps.com/mysql.php

i have put php file on web server(public_html) directory, and run Mr Taifun's aia file

but i have get error code 403

error screenshot is attached 

please help me on this error

thanks
Screenshot_20180701-141407.png

Chris Ward

unread,
Jul 1, 2018, 5:56:11 AM7/1/18
to MIT App Inventor Forum
Hello Dr. Sohil

Error code 403: The server understood the request, but is refusing to fulfill it. Authorization will not help and the request should not be repeated.


So, when you use Taifun's example file, have you modified it to point to your own web server?

......... and you are trying to connect with your own web server, right? You will probably need to include User Name and Password in the connection request. If the website is secured using HTTPS, there is potentially a bit more to do.


Dr. Sohil Harsoda

unread,
Jul 1, 2018, 6:25:01 AM7/1/18
to MIT App Inventor Forum
Thanks Sir for reply me

I have put php file on public html directory,
I have not done any change in php script on Mr. Taifun's example, but I change php file location on aia file

how can I include username and password while connection request. ?

thanks,


Taifun

unread,
Jul 1, 2018, 9:54:29 AM7/1/18
to MIT App Inventor Forum
I have not done any change in php script on Mr. Taifun's example

you might want to follow the setup instructions

Taifun

Dr. Sohil Harsoda

unread,
Jul 1, 2018, 10:08:44 AM7/1/18
to MIT App Inventor Forum
Thanks Taifun Sir for your reply.

Sir, I have follow steps that you said on https://puravidaapps.com/mysql.php#setup

But I have not do any changes in php script that you provide, is it ok or not ?

in aia file provided by you, I have done only two change 1) change location of php file & 2) change key from"randomkey" to "secret" as mentioned in your php script file

but it shows error 403.

Please suggest solution,

Thanks



Taifun

unread,
Jul 1, 2018, 10:47:10 AM7/1/18
to MIT App Inventor Forum
which means you did not follow the setup instructions

Setup

  • Put the PHP code on your web server
  • Set the SQLKEY in your app and in the PHP code, they must match for this code to work
  • Setup your database connection information in the php script
  • Try out the code

Taifun

Dr. Sohil Harsoda

unread,
Jul 1, 2018, 10:58:40 AM7/1/18
to MIT App Inventor Forum
Sir

I have seen "secret" as sqlkey in php script, so i have set "secret" in blocks as sqlkey

Ihave not idea about setup database connection information. So i have not set it, please inform us about how to do that

Thanks

Taifun

unread,
Jul 1, 2018, 2:08:43 PM7/1/18
to MIT App Inventor Forum
ask your web host about the correct settings, see also
https://www.cloudways.com/blog/connect-mysql-with-php/
or do a Google search..

you have to set the following variables in the php script

//DATABSE DETAILS//
$DB_ADDRESS="";
$DB_USER="";
$DB_PASS="";
$DB_NAME="";


Taifun
Reply all
Reply to author
Forward
0 new messages