cold, i would NOT directly connect from a program, you can "sniff" network packets and retreive the connection information...
I would use PHP connector scripts instead, send a POST request from your program to a specially designed script and you do not give the server user+pass to everyone...