PDA

View Full Version : ASP send via POST not sending vars


thriftynomad
11-06-2003, 06:50 PM
Hello all... I come grovelling in search of what is probably a fairly elementary answer...

I have been trying for days to pass info from Flash 2004 to an ASPmail script.

When I submit the following code, a new window opens with the variable name and pairs show in the URL... which I thought was only supposed to happen with a "GET" command, not "POST".

e.g. -- http://www.maxxquest.com/thur/mailer6.asp?fromaddress=abc%40123%2Ecom&fromname=John
(mouse over this to see the whole url in the status bar)

Either way, the script returns an error saying that necessary fields are blank.

All of my fields are on a single layer with no movie clips or other embedding... the two fields I'm trying to send are 'fromname' and fromaddress'

here's the actionscript for the submit button:

on (release) {
var mailtest = new LoadVars();
mailtest.fromname = fromname.text;
mailtest.fromaddress = fromaddress.text;
mailtest.send("mailer6.asp", "_blank", "POST");
}


here's the ASP script:

<html>
<head>
<title>11/05/03 - 12:23PM</title>
</head>

<body bgcolor="white">
<h3><font face="arial">Thank You</font></h3>

<%

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = Request.Form("fromname")
Mailer.FromAddress= Request.Form("fromaddress")
Mailer.RemoteHost = "www.server.com"
Mailer.AddRecipient "John Doe", "[email protected]"
Mailer.Subject = "Form Submission"

strMsgHeader = "Form information follows" & vbCrLf

for each qryItem in Request.Form
strMsgInfo = strMsgInfo & qryItem & " - " & request.Form(qryItem) & vbCrLf
next

strMsgFooter = vbCrLf & "End of form information"
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter

if Mailer.SendMail then
Response.Write "Form information submitted..."
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if

%>

</body>
</html>

I don't need any response to be sent back to the flash movie, just the confirmation from the script in the new HTML window...

Please, please, please... can anyone shed some light on this... I've researched every tutorial and movie I can find... all with no luck.

Thanks again in advance,
Greg.

nunomira
11-06-2003, 08:18 PM
hi,

You say (and show) that the variables are being sent via GET, although you specify POST.
Are you testing this on an html page?
Because if you use the standanlone player, or the test-movie player, they can't send variables via POST, and always use GET.

I don't know anything about asp, but in php and coldfusion you may specify that the variable have to be loaded via POST or GET.
If you specifyed POST in this script, that may be the reason.

thriftynomad
11-07-2003, 10:29 AM
thank you, thank you, thank you... (i could fill the page with thank-yous!!)

i had assumed since it was communicating with the script and returning something that the 'Test Movie' option would allow me to run those commands... I had no idea it wouldn't accept 'POST'... all works like a charm now.

Thanks yet again...

williamon9
12-08-2003, 03:32 PM
solved my problem too! thanks!! (didn't know POST won't work under test movie mode)

:D