Maybe your hosting provider does not allow displaying of errors. Check in web hosting control panel if there is any php or apache error logging.
There is quite a lot of code :-). Have you checked the database is set up correctly or Captcha is correctly used?
It would be good idea to get some code to external files (like Pphp functions, database connection, country selection element etc) which are then just included. It would make code much clearer.
In order you find the cause of the error you should do some simple debugging. I usually put a die statement on various places in PHP code and check if it shows up. Like you could add this on line 180:
die(DB_NAME);
and see if DB name gets displayed. If yes you can carry on between lines 181 and 182 with:
die("Connection: " . print_r($con, 1));
etc.
I will have to carry on tomorrow since it is almost nidnight here :-)