# Saving to Text File

**URL:** <https://forum.kirupa.com/t/saving-to-text-file/287466>\
**Category:** flash\
**Created:** [May 1, 2009, 3:43pm UTC](https://forum.kirupa.com/t/saving-to-text-file/287466 "2009-05-01T15:43:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Osteel](https://avatars.discourse-cdn.com/v4/letter/o/cab0a1/32.png) [@Osteel](https://forum.kirupa.com/u/Osteel)\
**Post date:** [May 1, 2009, 3:43pm UTC](https://forum.kirupa.com/t/saving-to-text-file/287466/1 "2009-05-01T15:43:28Z")

</div>

Okay okay, I know this is an old topic that frustrates many people. I was able to, at one point a few years ago, save and load to and from a text file. However, doing any tutorials found online currently (I’ve tried at least 10), I cannot seem to get it to work!

Flash Code:

```auto
myData = new LoadVars();

submit.onRelease = function() {
	myData.Name = Name.text;
	myData.sendAndLoad("save.php",myData,"POST");

};

```

Makes sense right? Now here is the PHP code that writes it to a text file:

```php
<?php
$name = $_POST['Name'];
$toSave ="Name=".$name;
 
$myfile = fopen("saveLocal.txt","w"); 
$fp = fwrite($myfile,$toSave); 
fclose($myfile); 
?>

```

I’ve tried other forums but nobody seems to be able to assist me. Hopefully someone here will be able to save me from my misery.

Thanks. :ponder:
