awesome_aims wrote:ok thanks, I know that's the problem now. In order to get rid of the iframe I must connect with the MySQL from a different server, if tried everything and it's still not letting me, through cpanel I allowed the host to access the mysql, and I'm trying to connect like this:
mysql_connect("11.111.1.111", "username", "password");
it's returning the error:
"Warning: mysql_connect(): Lost connection to MySQL server during query in /home/awesomea/public_html/csp.php on line 6"
iv'e also tried connecting to ports: 11.111.1.111:3306
and its returning the same error
You need to enable network connections on mysql. Be aware that you will then need to specify connection strings for all your stuff running locally once you set this up, unless you set the connection up in php.ini, which in a hosted environment is very insecure.
On linux, in /etc/my.cnf, you change the line that reads:
socket=/var/lib/mysql/mysql.sock
to
socket=3306
which is the standard mysql network port. You should then ensure that this port is blocked from any subnets but the subnet where your web servers are, with IPTABLES. You should then add users to mysql and be very specific about which IP's they are allowed to connect from.
In fact, if you don't add users to mysql and specify the allowed IP's, they won't even be able to connect at all. I'll leave the particulars of this stuff to the MySQL and IPTABLE's manuals/documentation. As always some effort expended in reading the docs and learning how it works will pay dividends.
Network enabling mysql can be very (VERY) dangerous if done improperly so make sure you do it in a secure manner with the help of a competent network engineer and system administrator/dba.
-Viz