I have a sign up and login system coded up and after logging in, every user can save their project (blockly) and the only way to do it is saving the XML file. So, I am generating the XML code for that project using a JavaScript function which is like this:
function export_1(){
var xml = Blockly.Xml.workspaceToDom(Code.workspace);
xml_text = Blockly.Xml.domToText(xml);
alert(xml_text);
}
I want this code to be automatically stored in MySQL database and update it if the user changes further.
I don't know how to do that. I am new to PHP and working with JavaScript and PHP.
First you have to send the xml to your server/aPhpScript.php (best via AJAX). There the PHP Script reads the $_POST['value']
and stores it into the database. Here is a good tutorial. Because you are new to the subject, I recommend to complete the totorial and ask more specific questions if you get stuck.
Have a nice day.