# \[MX\] Form Trouble

**URL:** <https://forum.kirupa.com/t/mx-form-trouble/8374>\
**Category:** flash\
**Created:** [November 19, 2002, 7:21pm UTC](https://forum.kirupa.com/t/mx-form-trouble/8374 "2002-11-19T19:21:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryall](https://avatars.discourse-cdn.com/v4/letter/r/53a042/32.png) [@Ryall](https://forum.kirupa.com/u/Ryall)\
**Post date:** [November 19, 2002, 7:21pm UTC](https://forum.kirupa.com/t/mx-form-trouble/8374/1 "2002-11-19T19:21:32Z")

</div>

Ok heres the deal: I have a comments form and it works fine on the site I origonally made it for - now using it on a new site it doesnt, this may be an MX issue, but I cant figure it out heres what I am using:

Main Action Frame of Form:

```php
stop();
function lineAdapt() {
	message_send = message;
	while (msg_count<length(message)) {
		msg_count = msg_count+1;
		if ((substring(message_send, msg_count, 2)) eq "\r") {
			message_send = (substring(message_send, 1, msg_count-2))+"
"+(substring(message_send, msg_count+2, (length(message_send))-msg_count+2));
		}
	}
	message = message_send;
	delete msg_count;
	delete message_send;
}

```

Action for Submit Button:

```php
on (release) {
	if (name eq "" or comments eq "") {
		gotoAndStop(2);
	} else {
		loadVariablesNum("comments.php", 0, "POST");
		gotoAndStop(3);
	}
}

```

PHP Script on my server:

\<?php  
mail([rwalsh@grafikdesigns.com](mailto:rwalsh@grafikdesigns.com), “Comments/Questions from $name”, "Information Submitted By User:

Name: $name  
Date: $date  
Phone Number: $phone  
Email: $email  
Questions/Comments: $comments", “From: $email  
Reply-To: $email  
X-Mailer: PHP/” . phpversion());  
?\>

Thanks for you help people - I just cant seem to see whats wrong!!

Peace

---

<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 19, 2002, 7:42pm UTC](https://forum.kirupa.com/t/mx-form-trouble/8374/2 "2002-11-19T19:42:47Z")

</div>

Hi,  
the only thing I can think of is that **eq** is now

```auto
==

```

and  
length is used like: **message.length**.  
you are also using variable called ‘name’ which could cause problems as Flash uses that to _name_ MCs

Cheers

SHO

---

<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 19, 2002, 9:00pm UTC](https://forum.kirupa.com/t/mx-form-trouble/8374/3 "2002-11-19T21:00:01Z")

</div>

Hey eki, thanks for the input…

I changed all my code for message.length also I changed ALL the variables in my code to: senderName, senderEmail, etc. and updated my PHP accordingly - BUT TO NO AVAIL! :\*(

This one is really getting the best of me - any more ideas, or anyone else have any?.. ☹

Peace

.::EDIT::.

Maybe there is a different or better way of doing this? My only requirements are I want to use PHP, and I am using Flash MX… origonally I made this with Flash 5, but since I’ve saved that same site in Flash 6 format and it still works there, but in this site I am making from the ground up in MX it is not. grrrrr:evil:

---

<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 20, 2002, 10:43pm UTC](https://forum.kirupa.com/t/mx-form-trouble/8374/4 "2002-11-20T22:43:09Z")

</div>

::BUMP::

I know I am missing something easy - I think I just need someones fresh view! Thanks

Peace

---

<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 20, 2002, 10:56pm UTC](https://forum.kirupa.com/t/mx-form-trouble/8374/5 "2002-11-20T22:56:06Z")

</div>

Hey Ryall,

I had a form done, PHP, and if u would like to have a look, leave a reply.

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 21, 2002, 4:22am UTC](https://forum.kirupa.com/t/mx-form-trouble/8374/6 "2002-11-21T04:22:56Z")

</div>

Yeah that might help me fix mine - thanks

Peace

---

<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 21, 2002, 8:01pm UTC](https://forum.kirupa.com/t/mx-form-trouble/8374/7 "2002-11-21T20:01:43Z")

</div>

Sorry ryall, but i really did’nt have time making an Fla, anyways, try using the script below and tell me how it goes:

```php
<?
$recipient = "h88@kirupa.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");
?>

```

yours,  
h88
