PDA

View Full Version : Form addressing code....



Pjc4real
January 6th, 2003, 09:02 AM
Hey guys! A question for scripting wizards!

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?

eyeinfinitude
January 6th, 2003, 11:10 AM
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. =)

Pjc4real
January 6th, 2003, 11:19 AM
Hey EG.....

Ok, so my code now looks like this:



on (release) {
loadVariablesNum("http://www.free-cgi.com/freecgi/form2mail/form2mail.asp", "", "POST");
}


Ive just created a text box (input), and given it the variable of my username, right?

eyeinfinitude
January 6th, 2003, 11:27 AM
that's correct. =) Username, I don't know if it's case sensitive

Pjc4real
January 6th, 2003, 11:30 AM
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?!!?:-\

eyeinfinitude
January 6th, 2003, 11:40 AM
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.

loadVariablesNum is what I used on my form.