?
Solved

sending variables to cgi script from flash

Posted on 2003-03-07
7
Medium Priority
?
156 Views
Last Modified: 2010-04-03
Ok this may be simple or not, but I need to send a variable called ADD to a CGI script, but flash action script recognises this as a command rather than a variable ...

e.g:
 
set (add,"1")


cheers
eric
0
Comment
Question by:ericno7
  • 3
  • 3
7 Comments
 
LVL 6

Expert Comment

by:henryww
ID: 8088348
how do u send the variable to the cgi?
can send the variables using "GET" instead of "POST"?

if so u can attache the variables in the querystring and that should solve the problem.


0
 
LVL 22

Expert Comment

by:rascalpants
ID: 8089025
you should use this to set the variable:

add = "1";  or add = 1;   //depending on if add is an int or string.

or if it is in the root of the movie:

_root.add = "1";  or _root.add = 1;


then just use a getURL("page.cgi?variable=add", "", "GET");

or getURL("page.cgi", "", "POST");


hope this helps...


rp



0
 
LVL 22

Expert Comment

by:rascalpants
ID: 8089044
and if you are in 4, then use:

Set Variable: "add" = "1";


rp
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:henryww
ID: 8089180
hmmmm ....

"add" is a reserved word, a common that's why it didn't work.

i think if ericno7 is only send a few variable, just make a querystring like
url = "something.pl?add="+addVal+"&name1="+rp+"&name2="+henryw
// where addVal, rp & henryw is the variable names

and use getURL(url,"_blank") or whatever way u use to send ...
0
 
LVL 22

Accepted Solution

by:
rascalpants earned 200 total points
ID: 8089209
I don't think it matters if it is a reserved word...  I am pretty sure as long as it is declared as a variable, it can be used...  but the problem he is having looks like a combination of that and not setting the value to the variable correctly...


rp
0
 

Author Comment

by:ericno7
ID: 8090556
Thanks it was due to the way I was setting the variable I used :

set ("add","1")

seems to have done the trick.

thanks for the replies

ericno7
0
 
LVL 6

Expert Comment

by:henryww
ID: 8090587
hmmm ... interesting :)

no no no ... don't let rp get more pts ... no no ... LOL ...

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question