MySQL Forums
Forum List  »  PHP

Database config in xml file
Posted by: Joe Moerret
Date: November 08, 2014 02:31PM

I need to create DB config file in xml for connecting with db in php application. And I create something like this

<?xml version="1.0"?>
<connection>
<host>localhost</host>
<user>antin</user>
<password>password</password>
<dbase>database</dbase>
</connection>
Then I can get host, user, password and dbase using SimpleXML. But I think that it isn't unsafe because everyone can parse this file. I think that that xml file have to be something like:

<?xml version="1.0"?>
<connection>
<host><![CDATA[localhost]]></host>
<user><![CDATA[antin]]></user>
<password><![CDATA[password]]></password>
<dbase><![CDATA[database]]></dbase>
</connection>
Can you help me to understand the right way for creation xml config file and getting connection info? Thanks!

Options: ReplyQuote


Subject
Written By
Posted
Database config in xml file
November 08, 2014 02:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.