all groups > flash actionscript > march 2004 >
You're in the

flash actionscript

group:

Matts mailForm


Matts mailForm jolyon_russ
3/31/2004 9:09:24 PM
flash actionscript: I have an interesting dilema.

I wish to create a flash webform.

I am familiar with actionscript, I know that I will could use the
LoadVars.sendAndLoad() method.

The problem I have is my web host has a copy of Matts formMail.php script on
the server which it suggests all users, use.

Is there any way of utilising this script by sending my vars from my swf to it.

I think my host doesn't allow other cgi files to be run from other parts of
the server. Is there any easy way to test this?

What other options do I have for setting up a mail form?

I already know there are loads of downloads on Flashkit so please don't send
me there, I've tried downloads from Flashkit and had no sucess yet, hence my
posting here.

Any help greatly recieved.


Jolyon.
Re: Matts mailForm Jack.
3/31/2004 9:29:52 PM
[quoted text, click to view]

download the php, examine what variables it expects / outputs,
model your LoadVars.sendAndLoad() method to interact,

or roll your own :)
http://www.jackleaman.co.uk/flash/two/mailer.html
this uses the Drawing API but can be modified to normal input textfields,
hth,
Re: Matts mailForm jolyon_russ
4/1/2004 8:08:14 AM
Jack,

Thanks for your reply.

I know I need to use the LoadVars.sendAndLoad() method, but I don't know how!

How can I transpose these variables from an HTML form into ActionScript:

<form method="post" action="http://homepages.plus.net/cgi-bin/form">
<input type="hidden" name="recipient" value="myAddress@myDomain.co.uk" />
<input type="hidden" name="subject" value="Feedback from my website" />
<input type=hidden name="required" value="email, realname">

and then send them?

Any more help greatly recieved.


Jolyon

Re: Matts mailForm Jack.
4/1/2004 2:08:15 PM
from -
<form method="post" action="http://homepages.plus.net/cgi-bin/form">
<input type="hidden" name="recipient" value="myAddress@myDomain.co.uk" />
<input type="hidden" name="subject" value="Feedback from my website" />
<input type=hidden name="required" value="email, realname">

something like -

sv = new LoadVars();
sv.recipient = "myAddress@myDomain.co.uk";
sv.subject = "Feedback from my website";
sv.required = ="email, realname";
lv = new LoadVars();
lv.onLoad = function(){
// use loaded variables, eg - response.text =lv.response;
};
sv.sendAndLoad("http://homepages.plus.net/cgi-bin/form", lv, "POST");

hth

Re: Matts mailForm jolyon_russ
4/1/2004 4:00:20 PM
Jack,

Thanks for your reply.

The help with the syntax is invaluable, thank you.

I found someone with the same problem, they had managed to solve it and are
sending me some files.

For reference, he said that flash won't allow you to send data to a cgi file
held under a different domain, for security reasons of course.

The implication of this being that I would not be able to use the script held
in my ISP's CGI-BIN.

What I had forgotten and was reminded by this guy was that, there is seperate
CGI space for each user. So I can upload php and swf files there, then
dynamically load in the swf into my movie. That way the address in the address
bar stays 'pretty' and the swf and php files will be in the same location.

Thanks for you help.


Jolyon.
AddThis Social Bookmark Button