# PHP to XML, Add new post instead of change

**URL:** https://forum.kirupa.com/t/php-to-xml-add-new-post-instead-of-change/222032
**Category:** flash
**Created:** [April 10, 2007, 9:32am UTC](https://forum.kirupa.com/t/php-to-xml-add-new-post-instead-of-change/222032 "2007-04-10T09:32:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![magjac](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@magjac](https://forum.kirupa.com/u/magjac)
#### Post date: [April 10, 2007, 9:32am UTC](https://forum.kirupa.com/t/php-to-xml-add-new-post-instead-of-change/222032/1 "2007-04-10T09:32:34Z")

</div>

Hi guys! thanx alot for your help, this is a really great flash community! I have one question that I hope you can help med with. I have this “writeit.php” script that functions well. But at this time it only changes the existing post. I want it to ADD a new post after the on that i already there. Anyone got a clue on what to change?

```auto
<?php

$mybody = stripslashes($_POST["adress"]);
$mytitle = stripslashes($_POST["namn"]);
$myort = stripslashes($_POST["ort"]);
$mytid = stripslashes($_POST["tid"]);
$posted = time();
$posted = strftime("%m/%d/%y", $posted);    

if(!$mytitle || !$mybody){
print "&returnMe=Server Error!";
exit;
}else{
$xml="<?xml version=\"1.0\" encoding=\"utf-8\"?>

";
$xml.="<site>
";
$xml.="<aboutMe Namn=\"".$mytitle."\" date=\"".$posted ."\" Adress=\"".$mybody."\" Ort=\"".$myort."\" Tid=\"".$mytid."\" >
";
$xml.="</site>";

$file= fopen("vinst1.xml", "w");

       fwrite($file, "$xml");
       print "&returnMe=1";

}
?>

```
