# Form addressing code

**URL:** <https://forum.kirupa.com/t/form-addressing-code/10722>\
**Category:** Uncategorized\
**Created:** [January 6, 2003, 2:02pm UTC](https://forum.kirupa.com/t/form-addressing-code/10722 "2003-01-06T14:02:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pjc4real](https://avatars.discourse-cdn.com/v4/letter/p/58f4c7/32.png) [@Pjc4real](https://forum.kirupa.com/u/Pjc4real)\
**Post date:** [January 6, 2003, 2:02pm UTC](https://forum.kirupa.com/t/form-addressing-code/10722/1 "2003-01-06T14:02:45Z")

</div>

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:

```php
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:

```php

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 6, 2003, 4:10pm UTC](https://forum.kirupa.com/t/form-addressing-code/10722/2 "2003-01-06T16:10:36Z")

</div>

You could use loadVariablesNum, it should look something like this:

```php
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. =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 6, 2003, 4:19pm UTC](https://forum.kirupa.com/t/form-addressing-code/10722/3 "2003-01-06T16:19:36Z")

</div>

Hey EG…

Ok, so my code now looks like this:

```php

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 6, 2003, 4:27pm UTC](https://forum.kirupa.com/t/form-addressing-code/10722/4 "2003-01-06T16:27:01Z")

</div>

that’s correct. =) Username, I don’t know if it’s case sensitive

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 6, 2003, 4:30pm UTC](https://forum.kirupa.com/t/form-addressing-code/10722/5 "2003-01-06T16:30:02Z")

</div>

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:

```php
You must provide a username for your form

```

But when I used the loadVariables, nuthing seemd to happen at all?!!?:-\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 6, 2003, 4:40pm UTC](https://forum.kirupa.com/t/form-addressing-code/10722/6 "2003-01-06T16:40:11Z")

</div>

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.
