Hi friends,
Requirements :
I have created a html page - to save a group of fields into a separate file
Through ajax function(AjaxLoad), i have send some value into file.php and save it.
I can able to reach the file.php, but its not creating the file.
code is follows
javascript
function AjaxLoad(LstrXML){
var xmlhttp;
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="file.php?contentd="+LstrXML;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
function stateChanged()
{
if (xmlhttp.readyState==4)
{
alert(xmlhttp.responseText);
}
}
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
{
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
}
php
$fh = fopen("XML/testFile.xml", 'w') or die("can't open file");
$stringData = "<item labelText ='Age' txtBoxSize='20' optionType='*'></item><item labelText ='Gender' txtBoxSize='20' optionType='*'>";
fwrite($fh, $stringData);
fclose($fh);
But its working in all browser's other than IE..What to do for compatibility?
What's the problem in it? Please guide me on this.
Thanks,
Praveen J