code:
function saveText() {
// create your VAR OBJECT
sendText = new LoadVars();
// Format variables for PHP
sendText.nameData = "&nameData="+nameData;
sendText.newFileName = "text1.txt";
//tell our script what to do WHEN/IF everything goes ok.
sendText.onLoad = function(success) {
if (success) {
//response is the variableName echo'd in the PHP file.
_root.saveResponse = sendText.response;
}
};
//finally call the PHP the script
sendText.sendAndLoad("http://www.yourDomainName.com/directoryName/saveMyText.php", sendText, POST);
}