# User form to be saved in a .txt file

**URL:** <https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716>\
**Category:** flash\
**Created:** [November 6, 2002, 7:29am UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716 "2002-11-06T07:29:14Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![kruza](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@kruza](https://forum.kirupa.com/u/kruza)\
**Post date:** [November 6, 2002, 7:29am UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/1 "2002-11-06T07:29:14Z")

</div>

I wanted to create a similiar thing to a feedback area on a flash site that saves the info to a .txt file or e-mails it (that would be hard i htink).

could someone post a tute?

---

<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:** [November 6, 2002, 7:34am UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/2 "2002-11-06T07:34:24Z")

</div>

Hey kruza,

Well, both would need a server-side script to work, if u would like to save ur information into txt, a php or any other language is a must, or u would like to send the information into ur email, it would be the same! so please tell me which would u need!?

yours,  
h88

PS. you should have a php enabled host to use those features!

---

<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:** [November 6, 2002, 8:42am UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/3 "2002-11-06T08:42:44Z")

</div>

yeh i have a php enabled host so either php or .txt file

php would be better i guess…thanks a lot!

---

<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:** [November 6, 2002, 8:46am UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/4 "2002-11-06T08:46:49Z")

</div>

Hi kruza,

I meant that if you want to save to a .txt, you should have a php script to save your information into txt, and if you want to send your information to your email, you’ll need also php!

So i want you to choose weather saving to a .txt using php OR sending the information to your email!

yours,  
h88

---

<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:** [November 6, 2002, 1:19pm UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/5 "2002-11-06T13:19:53Z")

</div>

saving to .txt using php would do fine!

thanks again

---

<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:** [November 6, 2002, 11:02pm UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/6 "2002-11-06T23:02:48Z")

</div>

the php e-mail form would acually bu much much easier… what you need to do is set it up so that each text box is saved as a variable… then you have it send an email with the variables inside the e-mail… i’ll type up a code for you and post it here but i g2g now

give me a little bit…

---

<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:** [November 6, 2002, 11:06pm UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/7 "2002-11-06T23:06:40Z")

</div>

sorry for the delay… here is the script…

---

<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:** [November 6, 2002, 11:08pm UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/8 "2002-11-06T23:08:21Z")

</div>

well, a php code that sends an email will look like:

```php
<?
$recipient = "email@msn.com";
unset($HTTP_POST_VARS['onLoad']);
unset($HTTP_POST_VARS['clear']);
$body = "The following information was submitted...

";
foreach($HTTP_POST_VARS as $key => $value) {
	$key = substr($key, 0, -4);
	$body .= "$key: $value
";
}
$from = $HTTP_POST_VARS['name_txt'] . " <" . $HTTP_POST_VARS['email_txt'] . ">";
mail($recipient, $HTTP_POST_VARS['subject_txt'], $body, "From: $from");
?>

```

---

<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:** [November 6, 2002, 11:09pm UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/9 "2002-11-06T23:09:17Z")

</div>

OMG! sorry it keeps acually making the stupid form… how do i pist it so its just the code? lol

---

<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:** [November 6, 2002, 11:09pm UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/10 "2002-11-06T23:09:50Z")

</div>

nvm… looks like he beat me to it…lol

---

<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:** [November 6, 2002, 11:27pm UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/11 "2002-11-06T23:27:15Z")

</div>

and in flash:

```php
// Create data handler and set onLoad event handler
dataHandler = new LoadVars();
dataHandler.onLoad = function(success) {
	if (success) {
		messageBox("Your data has been mailed by the server. Thank you for your feedback, and someone will be in touch with you shortly regarding your query");
	} else {
		messageBox("You data was not able to be sent due to a problem on the server. Please try again later!");
	}
}
dataHandler.sendAndLoad("simplemailer.php", dataHandler, "POST");

```

hope this helps!

yours,  
h88

---

<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:** [November 9, 2002, 10:54pm UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/12 "2002-11-09T22:54:51Z")

</div>

Please check the attached fla, and upload it into ur server, and tell me how it goes!

yours,  
h88

---

<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:** [November 12, 2002, 2:27am UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/13 "2002-11-12T02:27:12Z")

</div>

the previous one would’nt work, that one would!

yours,  
h88

---

<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:** [November 12, 2002, 2:30am UTC](https://forum.kirupa.com/t/user-form-to-be-saved-in-a-txt-file/7716/14 "2002-11-12T02:30:03Z")

</div>

sorry, forgot to attach :o

Description for what did i do:

User will enter his name and address, the name and address will be in the form of:

“name - address”, debug the code to suits u!

yours,  
h88
