# Sending Variables To ASP From Flash

**URL:** <https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231>\
**Category:** programming\
**Created:** [July 10, 2003, 6:38pm UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231 "2003-07-10T18:38:14Z")\
**Posts on this page:** 12\
**Page:** 1

<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:** [July 10, 2003, 6:38pm UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231/1 "2003-07-10T18:38:14Z")

</div>

Jubbas tute was great on PHP and Flash. Let’s clear up any question with ASP and Flash, as I have seen a few messages regarding this matter as of late.

**Part 1  
 Sending variables to ASP and printing them**

Create a form in flash containing 4 textboxes. Make one multiline.  
Variable names should be:  
name  
email  
website  
comments

Create a submit button and apply these actions to your timeline  
[AS]  
submit.onRelease = function(){  
getURL(“[http://www.delusionalfx.com/sendmail.asp",0,"post](http://www.delusionalfx.com/sendmail.asp%22,0,%22post)”);  
}  
[/AS]

Now your all done with the flash, let’s move on to the ASP file.  
Save this file as **sendmail.asp**

What we are doing here is pretty simple. We are requesting the variables values from flash and printing them.

```php

<% @Language=VBScript %>

<% 
name = Request.Form("name")
email = Request.Form("email")
website = Request.Form("website")
message = Request.Form("comments")
%>

<%=name%><br>
<%=email%><br>
<%=website%><br>
<%=comments%><br>

```

“\<%=” is short for saying Response.Write

Alrighty there is part one, let’s move on to the next section

---

<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:** [July 10, 2003, 6:40pm UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231/2 "2003-07-10T18:40:31Z")

</div>

**Part 2  
Sending captured variables to an email**

```php

<% @language="VBSCRIPT" %> 
<%

Dim myMail, myBody

myBody = "Name: "& request.form("name") & vbcrlf
myBody = myBody & "Email: "& request.form("email") & vbcrlf
myBody = myBody & "Website: "& request.form("website") & vbcrlf
myBody = myBody & "Message: "& vbcrlf & request.form("comments")

Set myMail = CreateObject("CDONTS.NewMail")

myMail.BodyFormat=1
myMail.MailFormat=1
myMail.From=request.form("email")
myMail.To=request.form("email")
myMail.Subject="Flash MX Test Email"
myMail.Body=myBody
myMail.Send

set myMail=nothing

%>

```

There ya go, sorry I have to run, I will give a full explanation of  
this code when I get home

btw. I wrote this for Alleen. I def will edit later!

---

<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:** [July 25, 2003, 9:37pm UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231/3 "2003-07-25T21:37:30Z")

</div>

When are you going to clean this up. I don’t understand your last post. Is that PHP script supposed to go in sendmail.asp also?

---

<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:** [July 26, 2003, 8:03am UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231/4 "2003-07-26T08:03:00Z")

</div>

that is not a php script, i use the php tags to embed the code.

that is the asp file. what do you need to be cleared up?

---

<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:** [July 26, 2003, 8:08am UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231/5 "2003-07-26T08:08:37Z")

</div>

interesting… 🙂

you might wanna write this up in a tutorial form so we can have it in the tutorials section if you don’t mind 🙂

---

<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:** [July 26, 2003, 5:19pm UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231/6 "2003-07-26T17:19:20Z")

</div>

yea that would be cool, that was my orginal thought, let me clean it up a 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:** [July 26, 2003, 6:18pm UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231/7 "2003-07-26T18:18:42Z")

</div>

Ok so both of the php tags go in the asp 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:** [July 26, 2003, 6:33pm UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231/8 "2003-07-26T18:33:14Z")

</div>

no copy and paste this, the php tags are here because that is the only way to show code on the FORUM page. if yu don’t wrap the code around those tags, the code will try to execute.

copy and paste, save as sendmail.asp

\<% @language=“VBSCRIPT” %\>  
\<%

Dim myMail, myBody

myBody = "Name: "& request.form(“name”) & vbcrlf  
myBody = myBody & "Email: "& request.form(“email”) & vbcrlf  
myBody = myBody & "Website: "& request.form(“website”) & vbcrlf  
myBody = myBody & "Message: "& vbcrlf & request.form(“comments”)

Set myMail = CreateObject(“CDONTS.NewMail”)

myMail.BodyFormat=1  
myMail.MailFormat=1  
myMail.From=request.form(“email”)  
myMail.To=request.form(“email”)  
myMail.Subject=“Flash MX Test Email”  
myMail.Body=myBody  
myMail.Send

set myMail=nothing

%\>

---

<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:** [July 26, 2003, 6:34pm UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231/9 "2003-07-26T18:34:36Z")

</div>

well i just screwed up this entire thread by not wrapping the code in the php tags

can a mod help please! 🙂

---

<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:** [July 26, 2003, 6:35pm UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231/10 "2003-07-26T18:35:25Z")

</div>

here is the code again, wow i can’t belivee i screwed this up, grr im so mad, it took me a while to write too… ☹

```php

<% @language="VBSCRIPT" %> 
<%

Dim myMail, myBody

myBody = "Name: "& request.form("name") & vbcrlf
myBody = myBody & "Email: "& request.form("email") & vbcrlf
myBody = myBody & "Website: "& request.form("website") & vbcrlf
myBody = myBody & "Message: "& vbcrlf & request.form("comments")

Set myMail = CreateObject("CDONTS.NewMail")

myMail.BodyFormat=1
myMail.MailFormat=1
myMail.From=request.form("email")
myMail.To=request.form("email")
myMail.Subject="Flash MX Test Email"
myMail.Body=myBody
myMail.Send

set myMail=nothing

%>

```

---

<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:** [July 27, 2003, 6:55am UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231/11 "2003-07-27T06:55:58Z")

</div>

Maybe I’m asking a stupid question (actually I got this feeling that i’m sure I am)  
but how do you get this to e-mail this information to you?

---

<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:** [July 31, 2003, 2:05pm UTC](https://forum.kirupa.com/t/sending-variables-to-asp-from-flash/25231/12 "2003-07-31T14:05:45Z")

</div>

myMail.cc=request.form(“Your email here”)
