Hello everybody !
I want to append in a xml file (if it exists otherwise create, specified xml file). Suppose my file is like-
/***************** append to this file:- test.xml *********/
<AIEE>
<id>1</id>
<name>Raaj</name>
<email>
[email protected]</email>
<title>News Posting</title>
<description>News posting provide facilities to post news by public</description>
//......... required append location
<AIEE>
//......... currently append location
************** Appendable contents in file "test.xml" ********
<id>1</id>
<name>pankaj</name>
<email>
[email protected]</email>
<title>Cricket match</title>
<description>There will held Cricket match on Oct 25, 2007 between India Vs Pakistan </description>
************************************************** ***
Now suppose i want to append some contents at
//.... Append location(see above). I have to do this by using php4.
I have successed to append my new contents at //.....current append location (see above).
********* php file for append "writexmlfile.xml"*********************
<?
$file_handle = fopen('test.xml','a');
$content=('<?xml version="1.0" ?>
<id>2</id>
<name>pankaj</name>
<email>
[email protected]</gmail>
<title>Cricket match</title>
<description>There will held Cricket match on Oct 25, 2007 between India Vs Pakistan </description>');
if(fwrite($file_handle,$content))
{
echo"u success to append xml file";
}
else
{
echo"u failed to append xml file";
}
fclose($file_handle);
?>
************************************************** **
Please tell me how can I do so....
thanx for attention !