# Php txt noob problems

**URL:** <https://forum.kirupa.com/t/php-txt-noob-problems/232825>\
**Category:** Uncategorized\
**Created:** [July 18, 2007, 4:53am UTC](https://forum.kirupa.com/t/php-txt-noob-problems/232825 "2007-07-18T04:53:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![npgames](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/npgames/32/2914_2.png) [@npgames](https://forum.kirupa.com/u/npgames)\
**Post date:** [July 18, 2007, 4:53am UTC](https://forum.kirupa.com/t/php-txt-noob-problems/232825/1 "2007-07-18T04:53:08Z")

</div>

first off, id like to thank [kirupa.com](http://kirupa.com) for its great tutorials, iv learned a lot.

now for my problem, i want to make a php script that will write to a text file over and over, but it seems it only works once, im not sure why

```auto

<?php
$xx = $_POST['xx'];
//works 
print "do not close this".$xx;
echo "do not close this".$xx;
//works only once
[COLOR=red]$file = fopen("chat2.txt","w+") or die("Cannot open the file");[/COLOR]
[COLOR=red]fwrite($file,"quote1=");[/COLOR]
[COLOR=red]fwrite($file,$xx);[/COLOR]
[COLOR=red]fclose($file);[/COLOR]
?> 

```

the code in red only works once, if anyone knows how to get it to work multiple times plz help

EDIT:

i found out the problem, it saves cookies from the page, and doesnt update untill i delete the cookies of the page, is there a way so flash will still download the txt file even if it has cookies???
