# Syntax error (i think?!) when using SendAndLoad

**URL:** <https://forum.kirupa.com/t/syntax-error-i-think-when-using-sendandload/211246>\
**Category:** Uncategorized\
**Created:** [December 29, 2006, 12:30am UTC](https://forum.kirupa.com/t/syntax-error-i-think-when-using-sendandload/211246 "2006-12-29T00:30:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zaid\_W1red](https://avatars.discourse-cdn.com/v4/letter/z/cab0a1/32.png) [@Zaid\_W1red](https://forum.kirupa.com/u/Zaid_W1red)\
**Post date:** [December 29, 2006, 12:30am UTC](https://forum.kirupa.com/t/syntax-error-i-think-when-using-sendandload/211246/1 "2006-12-29T00:30:08Z")

</div>

Hey guys,

So…here’s my code:  
ActionScript Code:  
[FONT=Courier New][LEFT]sendbtn.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000] **function** [/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#808080]_/this works  
name = “subscribeform”;  
subscribe = “Subscribe”;  
this.\_parent[“list[2]”] = “list[2]”;  
email = yemail.text;  
emailconfirm = yemail.text;  
attribute7 = sendFname;  
attribute2 = sendLname;  
attribute25 = 1;  
getURL(“[http://www.mydomain.com/mailinglists/?p=subscribe&id=1](http://www.mydomain.com/mailinglists/?p=subscribe&id=1)”, receive\_lv, “POST”);  
gotoAndPlay(“thanks”);  
 /[/COLOR]  
[COLOR=#808080]//this dont ☹_[/COLOR]  
[COLOR=#000000] **var** [/COLOR] send\_lv:[COLOR=#0000ff]LoadVars[/COLOR] = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000ff]LoadVars[/COLOR]COLOR=#000000[/COLOR];  
send\_lv[COLOR=#000000][[/COLOR][COLOR=#ff0000]“list[2]”[/COLOR][COLOR=#000000]][/COLOR] = [COLOR=#ff0000]“signup”[/COLOR];  
send\_lv.[COLOR=#0000ff]name[/COLOR] = [COLOR=#ff0000]“subscribeform”[/COLOR];  
send\_lv.[COLOR=#000080]subscribe[/COLOR] = [COLOR=#ff0000]“Subscribe”[/COLOR];  
send\_lv.[COLOR=#000080]email[/COLOR] = yemail.[COLOR=#0000ff]text[/COLOR];  
send\_lv.[COLOR=#000080]emailconfirm[/COLOR] = yemail.[COLOR=#0000ff]text[/COLOR];  
send\_lv.[COLOR=#000080]attribute7[/COLOR] = sendFname;  
send\_lv.[COLOR=#000080]attribute2[/COLOR] = sendLname;  
send\_lv.[COLOR=#000080]attribute25[/COLOR] = [COLOR=#000080]2[/COLOR];  
send\_lv.[COLOR=#0000ff]sendAndLoad[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“[http://www.mydomain.com/mailinglists/?p=subscribe&id=1](http://www.mydomain.com/mailinglists/?p=subscribe&id=1)”[/COLOR], receive\_lv, [COLOR=#ff0000]“POST”[/COLOR][COLOR=#000000])[/COLOR];  
[COLOR=#0000ff]gotoAndPlay[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#0000ff]trace[/COLOR]COLOR=#000000[/COLOR];  
setStatusCOLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR];  
[/LEFT]  
[/FONT]

SO basically, Im trying to submit to a phplist using the code above.

The top method (commented out), work, but obviously opens a browser window which I dont want.

The second method doesnt, and the only difference I can see in the way that the data is being sent is the send\_lv[“list[2]”] = “signup”, or at least th evariable named “list[2]”.

I cannot change this variable name PHP side so I have to find a solution using AS ☹

Ive tried using:  
this.send\_lv[“list[2]”] = “signup”;  
\_parent.send\_lv[“list[2]”] = “signup”;  
this.\_parent.send\_lv[“list[2]”] = “signup”;

To no avail, if its of any iterest, when I trace out send\_lv everything comes out fine except that the square brakcets from [“list[2]”] are URL encoded …could this be stopping the PHP from seeing the variable correctly?

Thanks to anyone that can help…this is seriously frustrating!

Zaid
