How to Convert this PHP code to Jquery ?

Posted by Nandkishorre under jQuery on 3/2/2015 | Points: 10 | Views : 371 | Status : [Member] | Replies : 1
Hi Team,

i have PHP code, here i need to convert this code to jquery in my application. If there is know anyone could you share 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);
}



Regards
Nanda Kishore.CH




Responses

Posted by: Sheonarayan on: 3/2/2015 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Hi Nand,

This may not be possible as php is the server side language and jQuery (actually JavaScript) is client side.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Nandkishorre, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response