Form's script can't conect to database

http://www.free-paid-surveys.info/newsletter_signup.php

The page above is a form used by customers to sign up. The form is backed by a PHP script that stores customer’s data to a MySQL database created in my account at infinityfree.com. The script filters customer’s data then connect and stores it to db.
Script runs well until connection command when a white page shows up without any error mesage, and data get not stored in db.
Please help me!

Hi and welcome to the forum

I had entered everything necessary on your form and when I clicked the button I saw error 500 in the browser console

So here are instructions on how to enable error reporting

9 Likes

Thank you for your peply! I will try your suggestions and will report the results.

2 Likes

I am back as I promised!

After all as a user of infinityfree.com hosting service I have no permissions to php.ini and server configuration files that may help. But there is a rule of hosting service that states:
“… please note that it’s NOT possible to connect to the free hosting databases from outside the hosting platform. This means you cannot access the database from desktop or mobile applications directly, or use them in applications hosted elsewhere.”
Now I am asking can it be the cause ?

If you are trying to connect to the database from outside of your domain name, then yes, that would be the cause.

6 Likes

By the way, review the code you have on this file
because I don’t see closed </body> </html> anywhere


5 Likes

Thank your for your prompt and deep analyzing reply!
Code elements you was lookingfor are in place, I tried to attache a screenshot but the system denies me.
So the question remain, the database connection via the link above, is in or out of my domain? This can make an explanation ! Please help decide

I can’t tell you which DB your PHP code is trying to connect to
and it probably doesn’t succeed, that’s why you have error 500

in one of the posts above I gave you instructions for error 500

Did you do that ? and what did you see as an error after you enabled error reporting?

7 Likes

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