PDA

View Full Version : Using vars in URL to pass on to php script


castyourvision
07-08-2003, 10:05 PM
hello,

I've been working on this for days, and sought help from several sources (forums and tutes)...maybe someone here can help.


The page that holds my swf receives a var from a form. I want my actionscript to recognize that var and pass it on to my php script - which then sends text back to flash. Seems straightforward enough...

I've got the dyn text part working, as long as I hardcode my var into it. For instance:

In my actionscript, this hardcoded version works (returns proper data to my movie):
loadVariables('http://www.castyourvision.net/vision_sites/content1_1.php?userid=pfleming, "_root.text");

Whereas This doesn't (gives me blank textfield):
loadVariables('http://www.castyourvision.net/vision_sites/content1_1.php?userid='+root.userid, "_root.text");

My PHP also works fine...as long as it receives the variable (as in first example above). But, for some reason, I can't get my as to pass along the var. here's my as:

loadVariables('http://www.castyourvision.net/vision_sites/content1_1.php?userid='+root.userid, "_root.text");

I've also tried loadVariablesNum and I've tried to use just +userid (instead of +root.userid) ...but I get nothing. Again - it works as long as I define userid in the code.

*One more piece of info. In my html page, I'm embedding the swf like this to make the var available to my movie:

src="basic.swf?userid=<? echo $userid; ?>"

...and this also is working just fine
(i.e. basic.swf?userid=pfleming)

Can anyone shed some light on this? Seems like I've tried *everything....

stealthelephant
07-08-2003, 10:22 PM
Ummm, if u use LoadVars objects i could help u then - i dont know any "old" flash :( :mad: