Hello, I'm trying to create a news feed for my website and I've found that I cant write to the XML document. My code is as follows...
<form action="scripts/processscript2.php" method="post" class="style6" />
<textarea id="textarea5" rows="20" cols="50" name="content">
<?
$fn = "texts/feed.xml";
print htmlspecialchars(implode("",file($fn)));
?>
</textarea>
<br />
<p align="left" class="style6">Make Changes to feed and update
<span class="style6">
<input name="submit5" type="submit" class="style6" id="submit5" value="Submit" />[/B]
That code displays the feed for my admin area. The following is the code that should write new data to it...
<?
$fn = "../texts/feed.xml";
$content = stripslashes($_POST['content']);
$fp = fopen($fn,"w") or die ("Error opening file in write mode!");
fputs($fp,$content);
fclose($fp) or die ("Error closing file!");
echo "<meta http-equiv=\"refresh\" content=\"0; url=../admin.php\" />\n";
?>
Could someone point me in the right direction and tell me where I'm gong wrong?