php - What is a safe way to connect to a API on a separate domain? -


background : creating website (in typical lamp environment) connects database via php/xml based api on different domain (but on same server). reason not want have database connection details sitting on domain working on. in order work i've enabled "allow-url-fopen" setting domain.

my question is, since way know how this, know better i.e. safer , more secure method of achieivng result?

if both domains reside on same server not need use http connected mysql, can still login mysql server locally providing right credentials domain connection information stored.

but not serve great security purpose, if connection details reside on same domain not security loop hole php pages not server in raw form long webserver configured use php fine. can , should keep them on same domain. in fact having publically accessible api database connection bigger loophole


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -