How to Convert this PHP code to Jquery ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JolieSaucier
Forum Newbie
Posts: 1
Joined: Fri Jun 02, 2017 1:47 am

How to Convert this PHP code to Jquery ?

Post by JolieSaucier »

i have PHP coding, at this I want to transform this code to jquery in my application. If there is anyone who could exchange the knowledge.

$xmlString;
if (isset($_POST['xmlString'])){
$filename = $_POST['xmlFilename'];
$xmlString = stripslashes($_POST['xmlString']);

$newFile = "_data/".$filename.".edit.xml";

//write new data to the file, along with the old data
$handle = fopen("../".$newFile, "w");
if (fwrite($handle, $xmlString) === false) {
echo "{error:\"Couldn't write to file.\"}";
}
else {
echo "{filename:\"".$newFile."\"}";
}
fclose($handle);
}
Last edited by requinix on Fri Jun 02, 2017 2:57 am, edited 1 time in total.
Reason: removed spam
Post Reply