# Submitting flash form to CGI/PERL

**URL:** <https://forum.kirupa.com/t/submitting-flash-form-to-cgi-perl/223090>\
**Category:** flash\
**Created:** [April 19, 2007, 1:14pm UTC](https://forum.kirupa.com/t/submitting-flash-form-to-cgi-perl/223090 "2007-04-19T13:14:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mangesh](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@Mangesh](https://forum.kirupa.com/u/Mangesh)\
**Post date:** [April 19, 2007, 1:14pm UTC](https://forum.kirupa.com/t/submitting-flash-form-to-cgi-perl/223090/1 "2007-04-19T13:14:13Z")

</div>

Hello,

I want to make flash form that submits user name and email id to a .pl file.

I want to make this in flash.

[http://panamahatsdirect.com/iframe/subscribe.html](http://panamahatsdirect.com/iframe/subscribe.html)

the code is:

\<form method=“POST” action=“[http://panamahatsdirect.com/cgi-sys/cgiwrap/cdazell/mrp/sub.pl](http://panamahatsdirect.com/cgi-sys/cgiwrap/cdazell/mrp/sub.pl)”\>  
\<p align=“center” class=“MediumBlue”\>\<span class=“style2”\>Learn How Panama hats are Made\<br /\>  
Receive a Tour of Ecuador \<br /\>  
& Production of the hats\</span\> \<br /\>  
\<span class=“style1”\>\<strong\>5 Free Video\</strong\>  
Series \</span\>\<br /\>  
First name:\<br\>  
\<input type=“text” name=“fname” size=“18”\>\<br\>  
Email address:\<br\>  
\<input type=“text” name=“email” size=“18”\>\<br\>  
\<input type=“hidden” name=“task” value=“subscribe”\>  
\<input type=“hidden” name=“list” value=“Facts-Myths”\>  
\<input type=“hidden” name=“language” value=“eng”\>  
\<input name=“submit” size=“18” type=submit style=" " class=“button” value=“Send Video” /\>  
\</p\>  
\</form\>

And the flash code is:

// ===============================================  
// Augment TextField Class  
// ===============================================  
TextField.prototype.onKeyDown = function () {  
if (Key.getCode() == Key.ENTER  
&& this.pressedOnce == undefined  
&& this.isFocused()) {  
this.onSubmit();  
this.pressedOnce = true;  
}  
};

TextField.prototype.onKeyUp = function () {  
if (Key.getCode() == Key.ENTER) {  
this.pressedOnce = undefined;  
}  
}

TextField.prototype.isFocused = function () {  
if (Selection.getFocus() == targetPath(this)) {  
return true;  
}  
return false;  
};

// ===============================================  
// Implement Form  
// ===============================================  
// Prepare the data transfer object.

set(facts,“Facts-Myths”);  
set(subs,“subscribe”);

var sender = new LoadVars();

// Activate Enter key for text fields.  
username\_txt.onSubmit = submitForm;  
Key.addListener(username\_txt);  
email\_txt.onSubmit = submitForm;  
Key.addListener(email\_txt);

// Set submit button handler.  
submit\_pb.setClickHandler(“submitForm”);

// Provide custom form submission function.  
function submitForm () {  
sender.fname = username\_txt.text;  
sender.email = email\_txt.text;  
sender.list = facts;  
sender.task = subs;  
sender.send(“[http://panamahatsdirect.com/cgi-sys/cgiwrap/cdazell/mrp/sub.pl](http://panamahatsdirect.com/cgi-sys/cgiwrap/cdazell/mrp/sub.pl)”, “\_blank”, “GET”);  
[//sender.send](https://sender.send)(“sendmail.php”, “\_blank”, “GET”);  
}

Please help me out from this.

Thanks
