View Full Version : Flash Form & Asp?
Alleen
July 3rd, 2003, 04:43 PM
Hi Everyone!
Thank you to your earlier responses. I had posted that I thought I had made a mistake in the form. But I didn't. Instead of the info going to a frame named "Result" I would like the submit pushbutton to send the form info to someone by email.
I'm not sure how to get it to go to email. It's an NT Server that supports ASP, I would like the whole form (input texts, checkboxes and comments fields to be sent by email. Is that possible with this form?
Please help - I'm losing it!! Thanks again!!
Digitalosophy
July 5th, 2003, 06:15 PM
yes all you have to do to capture the variables in asp is this:
<%
strName = Request.Form("name");
strEmail = request.Form("email")
%>
then use CDONTS to send mail. make sure you are using this AS
submit.onRelease= function(){
loadVariablesNum("mail.asp",0,"post");
}
if you need help with CDONTS(asp mail object) let me know
Digitalosophy
July 5th, 2003, 06:21 PM
here is a sample code that will uses CDONTS
<%
fn = Request.Form("fn")
Dim EmailFromAddress, EmailToAddress, Subject, Body, File
EmailFromAddress = "youremail"
EmailToAddress = "youremail"
Subject = "Test"
Body = Request.Form("comments")& Request.Form("em")
Set MailObj = Server.CreateObject("CDONTS.NewMail")
MailObj.BodyFormat = 1
MailObj.MailFormat = 0
MailObj.Send EmailFromAddress, EmailToAddress, Subject, Body, File
Response.Write "Thank You, Your Message Has Been Sent"
%>
Alleen
July 7th, 2003, 06:48 PM
I must be doing something wrong. Here is the AS that I'm using.
stop();
myCheck = [rvc,trs,mavc,vds,dmcs];
function checkDisplay(component) {
var j,s;
for(j in myCheck){
if(myCheck[j].getValue()) s += myCheck[j].getLabel()+"\n";
}
checke="You like:\n" + ((s.length) ? s : "Nothing");
}
for (i=0;i<myCheck.length;i++) {
myCheck[i].setChangeHandler ("checkDisplay") ;
}
_root.bar._visible=false;
// onChanged function
comment.onChanged = function(){
if (this.maxscroll>1) {
_root.bar._visible=true;
}
else _root.bar._visible=false;
}
onReset = function () {
// checkbox
var j;
for (j in myCheck) {
myCheck[j].setValue(false);
}
// text
name.text = "";
mail.text = "";
address.text = "";
city.text = "";
state.text = "";
zip.text = "";
phone.text = "";
comment.text = "";
bar._visible = false;
Digitalosophy
July 7th, 2003, 06:53 PM
your not submitting your values to the asp page. where is the actions for your submit button?
Alleen
July 7th, 2003, 06:59 PM
I put the AS you told me to use at the bottom but it still doesn't work.
I have the variables on a separate layer, this is what they look like:
formData = new LoadVars ();
formData.name = "";
formData.email = "";
formData.address = "";
formData.city = "";
formData.state = "";
formData.zip = "";
formData.phone = "";
formData.rvc = "";
formData.trs = "";
formData.vds = "";
formData.mavc = "";
formData.dmcs = "";
formData.comment = "";
replyData = new LoadVars ();
replyData.onLoad = myOnLoad;
I was thinking maybe I should put them on the same layer before the "submit.onRelease function" or after. I'm totally confused.
Here is a copy of the ASP I am using:
<%
Name = Request.form("name")
Email = Request.form("email")
Address = Request.form("address")
City = Request.form("city")
State = Request.form("state")
Zip = Request.form("zip")
Phone = Request.form("phone")
Rvc = Request.form("rvc")
Trs = Request.form("trs")
Vds = Request.form("vds")
Mavc = Request.form("mavc")
Dmcs = Request.form("dmcs")
Comment = Request.form("comment")
strName = "clients name"
strEmail = "clientsname@clientscompany.com"
strSubject = "Example Email"
strBody = Name & Email & Address & City & State & Zip & Phone & RVC & TRS & VDS & MAVC & DMCS & Comment
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = "smtp.clientscompany.com"
Mailer.FromName = Name
Mailer.FromEmail = Email
Mailer.FromAddress = Address
Mailer.FromCity = City
Mailer.FromState = State
Mailer.FromZip = Zip
Mailer.FromPhone = Phone
Mailer.FromRVC = rvc
Mailer.FromTRS = trs
Mailer.FromVDS = vds
Mailer.FromMAVC = mavc
Mailer.FromDMCS = dmcs
Mailer.FromComment = Comment
Mailer.AddRecipient strName, strEmail
Mailer.Subject = (strSubject)
Mailer.BodyText = strBody
if Mailer.SendMail then
Response.Write "_root.Mail.EmailStatus=Complete - Your mail has been sent"
else
Response.Write "_root.Mail.EmailStatus=Failure - Your mail was not sent - errors"
Response.Write Mailer.Response
end if
%>
I'm not sure what "CDONTS" are.
Alleen
July 7th, 2003, 07:00 PM
Sorry, that didn't post right, I'll try again:
<%
Name = Request.form("name")
Email = Request.form("email")
Address = Request.form("address")
City = Request.form("city")
State = Request.form("state")
Zip = Request.form("zip")
Phone = Request.form("phone")
Rvc = Request.form("rvc")
Trs = Request.form("trs")
Vds = Request.form("vds")
Mavc = Request.form("mavc")
Dmcs = Request.form("dmcs")
Comment = Request.form("comment")
strName = "Neil Flynn"
strEmail = "neilflynn@redkoh.com"
strSubject = "Example Email"
strBody = Name & Email & Address & City & State & Zip & Phone & RVC & TRS & VDS & MAVC & DMCS & Comment
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = "smtp.redkoh.com"
Mailer.FromName = Name
Mailer.FromEmail = Email
Mailer.FromAddress = Address
Mailer.FromCity = City
Mailer.FromState = State
Mailer.FromZip = Zip
Mailer.FromPhone = Phone
Mailer.FromRVC = rvc
Mailer.FromTRS = trs
Mailer.FromVDS = vds
Mailer.FromMAVC = mavc
Mailer.FromDMCS = dmcs
Mailer.FromComment = Comment
Mailer.AddRecipient strName, strEmail
Mailer.Subject = (strSubject)
Mailer.BodyText = strBody
if Mailer.SendMail then
Response.Write "_root.Mail.EmailStatus=Complete - Your mail has been sent"
else
Response.Write "_root.Mail.EmailStatus=Failure - Your mail was not sent - errors"
Response.Write Mailer.Response
end if
%>
Alleen
July 7th, 2003, 07:12 PM
In the Tutorial the submit button is a movie clip, so I put the AS for it at the bottom of the AS that I posted above. I'm going to leave something out of the ASP file so I can post it here:
Name = Request.form("name")
Email = Request.form("email")
Address = Request.form("address")
City = Request.form("city")
State = Request.form("state")
Zip = Request.form("zip")
Phone = Request.form("phone")
Rvc = Request.form("rvc")
Trs = Request.form("trs")
Vds = Request.form("vds")
Mavc = Request.form("mavc")
Dmcs = Request.form("dmcs")
Comment = Request.form("comment")
strName = "clientsname"
strEmail = "clientsname@clientscompany.com"
strSubject = "Example Email"
strBody = Name & Email & Address & City & State & Zip & Phone & RVC & TRS & VDS & MAVC & DMCS & Comment
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = "smtp.clientscompany.com"
Mailer.FromName = Name
Mailer.FromEmail = Email
Mailer.FromAddress = Address
Mailer.FromCity = City
Mailer.FromState = State
Mailer.FromZip = Zip
Mailer.FromPhone = Phone
Mailer.FromRVC = rvc
Mailer.FromTRS = trs
Mailer.FromVDS = vds
Mailer.FromMAVC = mavc
Mailer.FromDMCS = dmcs
Mailer.FromComment = Comment
Mailer.AddRecipient strName, strEmail
Mailer.Subject = (strSubject)
Mailer.BodyText = strBody
if Mailer.SendMail then
Response.Write "_root.Mail.EmailStatus=Complete - Your mail has been sent"
else
Response.Write "_root.Mail.EmailStatus=Failure - Your mail was not sent - errors"
Response.Write Mailer.Response
end if
I left the brackets out purposly, I hope you can see it now.
Digitalosophy
July 7th, 2003, 07:28 PM
i am not familiar with that code, your using smtp, let me cook up a little tute for you, ill do it by tonight
Digitalosophy
July 7th, 2003, 07:29 PM
if Mailer.SendMail then
Response.Write "_root.Mail.EmailStatus=Complete - Your mail has been sent"
else
Response.Write "_root.Mail.EmailStatus=Failure - Your mail was not sent - errors"
Response.Write Mailer.Response
end if
is that flash code in an asp page?????????????????????? if not your code is way off, you cant do that with asp
Digitalosophy
July 7th, 2003, 10:51 PM
these guys pretty much cant explain it any better. i think ur confuing the flash and asp code
http://www.webthang.co.uk/tuts/tuts_fmx/gfmx4/gfmx4_1.asp
Digitalosophy
July 8th, 2003, 04:47 PM
Any luck?
Alleen
July 8th, 2003, 05:10 PM
I think so, but, I'm not sure - I had the ASP page all wrong. (I guess you knew that!!). I have it running - it's going to the ASP page, but, I'm not sure if all the information is getting there or not. I'm going to change the email address to my own and fill out the form to see what I get.
I'll let you know - and I thanks for all the help you have been giving me, I really appreciate it!
Digitalosophy
July 8th, 2003, 05:23 PM
yea no prob, real quick though:
i hope you know you can not just run an asp page from it's current location. you need to configure IIS (Internet Information Server) it's stored under admin options on your start menu. also you will need to configure your SMTP mail server on your machine. I woudl consider signing up for a free account with brinkster http://www.brinkster.com just to et it working then configure yourw own machine. also i windows millinium doesn't support IIS :) Hope you know what i am talking about, if not let me know and I will explain further.
and im hope im not insulting ur intelligence, just trying to get you set up.
to run an asp file go tto your browser and type
http://localhost/yourpage.asp
run a quick test to see if it's configured. create an asp page and apply this code
<% response.write "Test" %>
when you call the page as i advised if you dont see test, you don't have IIS configured properly or you might not have it installed
Alleen
July 8th, 2003, 06:41 PM
Not a problem - believe me, I am completely new to "ASP" stuff so my intelligence is if anything - IMPROVING!! LOL
I installed IIS, but I'm not sure if I configured it the right way. I don't see the test you told me to try.
I installed IIS. The "Personal Web Manager" is up. I created a "default.asp" and saved it in: Inetpub/wwwroot this is what the default.asp page looks like:
<%
fn = Request.Form("fn")
Dim EmailFromAddress, EmailToAddress, Subject, Body, File
EmailFromAddress = "youremail"
EmailToAddress = "youremail"
Subject = "Test"
Body = Request.Form("comments")& Request.Form("em")
Set MailObj = Server.CreateObject("CDONTS.NewMail")
MailObj.BodyFormat = 1
MailObj.MailFormat = 0
MailObj.Send EmailFromAddress, EmailToAddress, Subject, Body, File
Response.Write "Thank You, Your Message Has Been Sent"
I have the Personal Web Manager up it still shows me the name of my computer - I must have done something wrong cuz I thought that it was supposed to change?
I'm not sure what to change in the "Advanced Tab".
Digitalosophy
July 8th, 2003, 09:51 PM
ok let's start from the beginning. Do this
Right click on toolbar next to your start menu
Go to properties>>start menu>>customize
click display administrative tools. ( I am on xp your might be a bit different)
click apply and close the properties box
then go to your start menu>>programs>>admin tools>>IIS
once IIS is open expand the tree
go to wesites>>default website>>right click>>properties
Leave everything as is, make the port 80
execute permissions should be scripts and executables
go to home directory and defien your local path(your web folder)
grant all permissions for now just to test
now your done configuring IIS
open notepad and save this file as "test.asp"
<%@ Language = "VBScript" %>
<% Response.Write "This is a test" %>
make sure that file is in your local path that you earlier defined.
type in your browser
http://localhost/test.asp
but if Inetpub/wwwroot isnt you'r defined path make sure to include the true path
there ya go that should do it, when you go to that page that you made you should see the words "This is a test".
I'll look at your script
Digitalosophy
July 8th, 2003, 10:01 PM
this code takes three variables from flash and sends it to a specified email
<% @language="VBSCRIPT" %>
<%
Dim myMail, myBody
myBody = "Name: "& request.form("name") & vbcrlf
myBody = myBody & "Email: "& request.form("email") & vbcrlf
myBody = myBody & "Message: "& vbcrlf & request.form("message")
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 Basic Email"
myMail.Body=myBody
myMail.Send
set myMail=nothing
%>
save that file as "mail.asp"
create 3 text fields in flash
variables are
name
email
message
subit button actions
on (release) {
getURL("mail.asp", "", "POST");
}
this code works, i tryed it
Digitalosophy
July 8th, 2003, 10:06 PM
oh and not to kill it but this only worked on my web server. i dont have my smtp configured properly
Alleen
July 9th, 2003, 11:45 AM
The test worked. I am on the right track with that. I have a question. I have my Variables on a separate layer then my Action Script in Flash, could this be causing the problem?
Here is a copy of the ASP page that I created with the added variables that I need. I'm not sure if I entered them right or not.
<% @language="VBSCRIPT" %>
<%
Dim myMail, myBody
myBody = "Name: "& request.form("name") & vbcrlf
myBody = myBody & "Email: "& request.form("email") & vbcrlf
myBody = myBody & "Address: "& request.form("address") & vbcrlf
myBody = myBody & "City: "& request.form("city") & vbcrlf
myBody = myBody & "State: "& request.form("state") & vbcrlf
myBody = myBody & "Zip: "& request.form("zip") & vbcrlf
myBody = myBody & "Phone: "& request.form("phone") & vbcrlf
myBody = myBody & "rvc: "& request.form("rvc") & vbcrlf
myBody = myBody & "trs: "& request.form("trs") & vbcrlf
myBody = myBody & "vds: "& request.form("vds") & vbcrlf
myBody = myBody & "mavc: "& request.form("mavc") & vbcrlf
myBody = myBody & "dmcs: "& request.form("dmcs") & vbcrlf
myBody = myBody & "Comment: "& vbcrlf & request.form("comment")
Set myMail = CreateObject("CDONTS.NewMail")
myMail.BodyFormat=1
myMail.MailFormat=1
myMail.From=request.form("email")
myMail.To="alleenb@optonline.net"
myMail.Subject="Flash MX Basic Email"
myMail.Body=myBody
myMail.Send
set myMail=nothing
When I press the submit button after filling out the form, it says the message is sent, but I don't receive the email. When I did yours - it worked. I think I'm still not doing something right. Maybe it's the way I have my variables, this is what they look like and like I said before, they are on their own layer in Flash.
formData = new LoadVars ();
formData.name = "";
formData.email = "";
formData.address = "";
formData.city = "";
formData.state = "";
formData.zip = "";
formData.phone = "";
formData.rvc = "";
formData.trs = "";
formData.vds = "";
formData.mavc = "";
formData.dmcs = "";
formData.comment = "";
replyData = new LoadVars ();
replyData.onLoad = myOnLoad;
This is driving me crazy.....and by now...maybe you, I'm sorry for being such a pain in the butt. I really appreciate all that you have done for me.
Thanks again!
Digitalosophy
July 9th, 2003, 11:59 AM
errrr, im not sure what happened to that long explanation i gave went, did soemone delete it?
anywho, you don't need to do that. just set your variables in your properties panel, and on your submit button
on(release){
getURL("yourpage.asp",0,"post");
}
thats it. why dotn you attach both your files, so I can take a look.
oh and I don't mind, our servers are down today woOt!!!!
Alleen
July 9th, 2003, 12:19 PM
Which files do you want me to attach? The Flash and the ASP page?
Digitalosophy
July 9th, 2003, 12:22 PM
yup
Alleen
July 9th, 2003, 12:56 PM
How do I do it? There doesn't seem to be a button for it?
Digitalosophy
July 9th, 2003, 01:03 PM
lol yea post a reply and attach a zip file with both files in there
Alleen
July 9th, 2003, 01:39 PM
Am I stupid or what, I can find the stupid "Browse" button!
Alleen
July 9th, 2003, 01:43 PM
OK, I'm not having a good dayat all. I'm a little dense...I know! Let me know when you are ready!
I'm really sorry for causing you so much trouble!!
Thanks Again,
Alleen
Digitalosophy
July 9th, 2003, 01:50 PM
hit post reply to this post, and look toward the bottom, for a BROWSE button
Alleen
July 9th, 2003, 03:00 PM
I did it, did you get it?
Digitalosophy
July 9th, 2003, 03:02 PM
lol get what? where is it? do this
sosick@digitalosophy.com
just email me them!@!@!@@!@ :)
i am leaving work now ill be home in an hour
Digitalosophy
July 10th, 2003, 02:44 PM
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=28108
SLamaJama
July 29th, 2003, 08:26 PM
ohh man its kinda confusing ... i;ve set up the IIS and from the admin control..its working fine..how can i be sure..and where is my wwwroot file can someone explain? im kinda new to connection of database...thanks!
Digitalosophy
July 29th, 2003, 09:17 PM
go into admin tools >>> IIS
once your there, click onthe tree to expand it
click on the web site tree and right click on default website and go to the properties
go to home directory. your location path will be the folder with your website in it. the persmissions should be read and write, since you will most likely want to write to your database
execute permissions should be scripts and executables
now that you set your site up, you can accees it by typing this in your browser
http://localhost/yourpage.asp
a good way to test your server is to create an asp page that contains this
<%= "test" %>
name it test.asp and access it by http://locahost/test.asp
there ya go that should get you set up. if you recieve and error message just post the error
:)
DigitalPimp
July 29th, 2003, 10:38 PM
IIS is about the simplest thing to install. Once it is installed however, it is very insecure because with anything prior to .NET server (ie IIS5 or below) came wide open with no passwords. I would recommend that you go to your control panel->administrative tools-> Internet Information Services and disable everything except for Default web and Admin web. I surely wouldn't enable the FTP because it is about as tough to break as a toothpick.
NOTICE: Don't do any of the above said stuff until you get it working.
Your default IIS directory will be c:\inetpub\wwwroot, this is also insecure and there are a lot of viruses that will crawl the net looking for IIS's with default configs hack them and then replace the default.html. I have personally seen this happen. As a security precaution I move my wwwroot to some where else on my server or rename the folder and then make sure you go into IIS and reconfigure the folder structure. (This is all more advanced stuff and wouldn't attempt any of it until your get comfortable with IIS. If you want any more help then you can IM me @ TheDP927
SLamaJama
July 30th, 2003, 08:43 PM
ok its all working now... so i can decode all codes n post it to flash mx directly...? or i still need to d.l asp script(i hope not)... currently i work for my attachment in a co. and d/l software online will need to go thru serious hassle autorisation procedures... i hope u undestand wht i mean
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.