# Saving text entered in flash onto a txt or php

**URL:** https://forum.kirupa.com/t/saving-text-entered-in-flash-onto-a-txt-or-php/84248
**Category:** flash
**Created:** [March 25, 2005, 6:39pm UTC](https://forum.kirupa.com/t/saving-text-entered-in-flash-onto-a-txt-or-php/84248 "2005-03-25T18:39:57Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Haxorleet](https://avatars.discourse-cdn.com/v4/letter/h/8491ac/32.png) [@Haxorleet](https://forum.kirupa.com/u/Haxorleet)
#### Post date: [March 25, 2005, 6:39pm UTC](https://forum.kirupa.com/t/saving-text-entered-in-flash-onto-a-txt-or-php/84248/1 "2005-03-25T18:39:57Z")

</div>

I’ve done a search on this forum for this but so far no luck concerning on how to do this the php way, only cookies…

Is there a way to save text that people input to a textbox into a .txt using .php so it can be loaded into the textbox everytime somebody sees it using the loadVars function?

Here is what I have so far but it won’t work… I’m very much php illiterate.

```php
$filename = $ai.".txt";
$dir = "/";
$fullpath = $dir.$filename;
$handle = fopen ($fullpath, "w+");

fwrite($handle, $_POST["text"]);

fclose($handle);

```

I named the php file “comments.php” Then in Flash I put this…

[AS]\_parent.loadVariables(“comments.php”);[/AS]

Then I get lost.
