I have constructed a simple contact form in MX. On the SEND button, I have the following code:
on (release) {
getURL("http://www.free-cgi.com/freecgi/form2mail/form2mail.asp", "", "POST");
}
As I don’t have acces to CGI on my space, I’m using a free service. They give instructions on how to modify the form in HTML as follows:
In the form tag write:
<FORM METHOD="POST"
ACTION="http://www.free-cgi.com/freecgi/form2mail/form2mail.asp">
In the form, include your Free-CGI username:
<INPUT TYPE=HIDDEN NAME=Username VALUE="your-username">
However, as I’ve built my form in Flash, how do I duplicate the above command in ActionScript? Is this possible? I just need to somehow add my username… ne ideaz?
You could use loadVariablesNum, it should look something like this:
on (release) {
loadVariablesNum("http://www.free-cgi.com/freecgi/form2mail/form2mail.asp", "", "POST")
}
Make sure all your input fields have the correct variable names that your cgi script uses and to create the hidden field just create a input field, apply the right variable to it and then resize it to 1px by 1px. It will appear as a tiny dot to you, but should now show up when you test the movie. Good luck. =)
Nuthing seems to happen when I replace getURL with loadVariableNum… isn’t that command to retrieve info??? SOrry, I am a COMPLETE novice at AxnScript still!!!;(
I created my text box in the same MC
The thing is, when I used my previous code, it did direct the browser to a page… which said:
You must provide a username for your form
But when I used the loadVariables, nuthing seemd to happen at all?!!?:-\
with loadVariablesNum, you can post variables to the serverside script as well hense the “POST” at the end of the script. If you use getURL, it’s just opening the script in a new browser but doesn’t send any variables so that’s why you recieved that message for a user name.