Uploading data to sql database using nodeMCU through php file

The code is working fine on local server. I uploaded those files on infinity free webserver after changing the credentials. Now When “http” is written in url, I get http response code 200 and When “https” is written in url, I get https response code 400. But the data is not being uploaded in both cases. Is there any kind of security for making external connection with nodeMCU?

Our database servers are not accessible from the internet. We provide database servers for use by PHP code on our web hosting, so our database servers can only be accessed from within our network. Remote database access is only available with premium hosting.

2 Likes

I tried this same application in the month of october 2022. Data was being uploaded. But now with the same code, I’m having this issue. Did something changed during this period?

Also the php file is placed in htdocs folder

Just to clarify: is the program on the MCU connecting directly to the database or is it calling a PHP script on your website? I assumed the former but reading it again I may have been wrong.

In any case, the latter isn’t supposed to work either. Again, we provide a service for website hosting, not for IoT data collection. And we have this system in place to help ensure this:

Actually status code 400 or “a 4xx status code”, which could also be status code 403? I can’t think of anything that would cause our hosting to return a 400 status code, which seems to me like it might be your website code that’s refusing the input from your MCU.

2 Likes

MCU is connecting to the php script placed in htdocs. I wants to know that how was I able to send data earlier as I mentioned and can this be done If I upgrade my account to premium?

Yes

1 Like

Are you sure? Have you tried it?

I have no idea. The fact that it worked before is the most surprising part to me, because it shouldn’t work.

I would expect it not to have worked ever due to the browser validation system. If that were the case, I would tell you to upgrade to premium, which doesn’t have this system.

So I don’t know why it did work before, so I’m not sure why it stopped working.


Do you have some way to reproduce the HTTP call made by the MCU we can reproduce? With a curl command for example? If we can reproduce the issue, maybe we can get a better idea as to why it doesn’t work now, or whether this could work on premium hosting.

3 Likes

If we open a url in any browser the data gets updated into the sql table, but when we open the same url through MCU we get a java script in return as it was mentioned. I can give you the url. http://neppa.epizy.com/2.php?r=1&lt=2&lg=3

Like what admin had said, is due to this

2 Likes

Can you provide Quotation for premium plans?

You can find the premium hosting prices on iFastNet’s website. If you want to know more about their pricing, please ask iFastNet directly, because they provide the hosting, we don’t.

1 Like

ok. Did you tried the url I provided earlier and can you please check if this url will work on premium hosting or not? It would be very helpful.

Any automated access to any URL should work on premium hosting. I don’t know what you want me to check, we’ve already told you why it doesn’t work and that using premium hosting will fix this.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.