DOMDocument Load XML giving error & quotes insert error
Posted on 2008-11-13
I have a user form and the clients fill the information. On submit, Im making it as XML and posting it to XML. Now the problem happend when sombody enters any special chanrachters like "&" or double quotes. then the xml is not loaded. it but if a plain text is inserted then its all fine.
The user on the web is free to insert any text in the textbox, so how can i tackle this problem.
Secondly, what if in the text user inserts " double quotes, then my query gives error.
I tried using addslash but for some reason it doesn\t work.
$objDOM = new DOMDocument();
above is the code for loading the xmlstring which is posted by the form.