# Php add to text file

**URL:** <https://forum.kirupa.com/t/php-add-to-text-file/29023>\
**Category:** Uncategorized\
**Created:** [August 21, 2003, 7:23am UTC](https://forum.kirupa.com/t/php-add-to-text-file/29023 "2003-08-21T07:23:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scootman](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@Scootman](https://forum.kirupa.com/u/Scootman)\
**Post date:** [August 21, 2003, 7:23am UTC](https://forum.kirupa.com/t/php-add-to-text-file/29023/1 "2003-08-21T07:23:48Z")

</div>

ok i am sorta new to php but i am trying to make php append text to a text file… ive made a flash form with 2 input text boxes with the variables “name” and “message” and in the button i have the code

```auto

loadVariablesNum("board.php", 0, "POST");

```

now in my board.php file i have

```php

<?php

$file = 'board.txt';

chmod ($file, 0777);

$msg = "Name: $name

";

$msg.= "Message: $message

";

$fp = fopen($file, "a+");

fwrite($fp, $msg);

fclose($fp);

?>

```

and also with the swf and the php i uploaded a file called “board.txt” with the text in it saying “messageBoard=” so when i append text i can read it back into flash to load it into a text box… but for some reason my text file never gets edited at all… i have looked at a hit counter post by jubba to get the file read/write stuff and to learn about the chmod stuff (with a little online searching) and this is what i came up with… yes, the server i upload to supports php because i have a php/flash mail form i tested on there (thanks to you smart people here at kirupa) so i was hoping you could tell me what im doing wrong on this very very basic version of a message board… thanks in advance to anybody that can help

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2003, 7:41am UTC](https://forum.kirupa.com/t/php-add-to-text-file/29023/2 "2003-08-21T07:41:43Z")

</div>

see jubba’s thread on storing data in textfiles, that should get you on the right track

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2003, 9:45pm UTC](https://forum.kirupa.com/t/php-add-to-text-file/29023/3 "2003-08-21T21:45:29Z")

</div>

k thanks

umm ahmed after some searching i seem to not be able to find that thread… can you help me out plz

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2003, 10:10pm UTC](https://forum.kirupa.com/t/php-add-to-text-file/29023/4 "2003-08-21T22:10:18Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?threadid=17604&highlight=ahmed](http://www.kirupaforum.com/forums/showthread.php?threadid=17604&highlight=ahmed)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2003, 10:46pm UTC](https://forum.kirupa.com/t/php-add-to-text-file/29023/5 "2003-08-21T22:46:50Z")

</div>

thanks
