system
July 10, 2003, 6:38pm
1
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 ”);
}
[/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.
<% @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
system
July 10, 2003, 6:40pm
2
Part 2
Sending captured variables to an email
<% @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!
system
July 25, 2003, 9:37pm
3
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?
system
July 26, 2003, 8:03am
4
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?
system
July 26, 2003, 8:08am
5
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
system
July 26, 2003, 5:19pm
6
yea that would be cool, that was my orginal thought, let me clean it up a bit
system
July 26, 2003, 6:18pm
7
Ok so both of the php tags go in the asp script?
system
July 26, 2003, 6:33pm
8
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
%>
system
July 26, 2003, 6:34pm
9
well i just screwed up this entire thread by not wrapping the code in the php tags
can a mod help please!
system
July 26, 2003, 6:35pm
10
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…
<% @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
%>
system
July 27, 2003, 6:55am
11
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?
system
July 31, 2003, 2:05pm
12
myMail.cc=request.form(“Your email here”)