| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Jan 2001
Location: Lafayette, Louisiana
Posts: 15
|
I'm trying to send variables to a php page, but having no luck.
On a button I've got this script: on (release) { _root.getCountry("Algeria"); } This is the function, on frame 1, main timeline: function getCountry (country) { getURL ("http://www.coatimundi.com/country.php", "_blank", "POST"); } The php script is: <?php print($HTTP_POST_VARS['country']); ?> I want a new browser window to pop up with the country name , in this case Algeria, printed across the top. It's not working...can you tell me why? thanks, coati |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
Prolly because your country var is just an interim var and not a global variable (since it's being defined only for that loop of that function) and hence it isn't being passed. or something like that.
You'd be better off using: on (release) { _root.getCountry("Algeria"); } function getCountry (country) { _root:country = country; getURL ("http://www.coatimundi.com/country.php", "_blank", "POST"); } Or soem such. This way you'll have avariable called 'country' on the mains tage when you call your PHP and it should definantly be posted. Try echoing your country var in your php to text if it's comming through also ( "echo $country;" should do the trick, within the body of the HTML). Also note this quote from the PHP manual: --------------------------------------------- HTTP_POST_VARS An associative array of variables passed to the current script via the HTTP POST method. Only available if variable tracking has been turned on via either the track_vars configuration directive or the <?php_track_vars?> directive. --------------------------------------------- So it sounds like your doing it a complicated way, why not just make your PHP: <?php echo $country; ?> That should do the same and will work more often on more servers. Cheers Jesse
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jan 2001
Location: Lafayette, Louisiana
Posts: 15
|
It's working great, but...
how can I format the output of the echo command? I mean make it bold, change the font size, etc. coati |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Jan 2001
Location: Lafayette, Louisiana
Posts: 15
|
For anyone else who may have this problem, I just put the html commands outside the <?php ?> tags.
Thanks again, coati |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sending Flash Variables to a PHP file - Cant get it to work - please help. | jamosb23 | Server-Side Scripting | 3 | 08-16-2005 06:04 AM |
| Problem sending special characters to PHP | Phil_NZ | Server-Side Scripting | 2 | 08-08-2005 10:36 PM |
| Sending variables to PHP | acornFlyer | Server-Side Scripting | 3 | 08-04-2005 01:47 PM |
| send variables to php without opening new window | blaise | ActionScript 1.0 (and below) | 3 | 06-14-2005 12:37 AM |
| Sending Flash variables to PHP | alphabug | Other Flash General Questions | 1 | 08-02-2003 03:10 AM |