Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > Server-Side Scripting

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-07-2001, 02:01 PM   #1
coatimundi
Registered User
 
Join Date: Jan 2001
Location: Lafayette, Louisiana
Posts: 15
Default

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
coatimundi is offline   Reply With Quote
Old 02-07-2001, 02:19 PM   #2
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

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.
Jesse is offline   Reply With Quote
Old 02-07-2001, 04:58 PM   #3
coatimundi
Registered User
 
Join Date: Jan 2001
Location: Lafayette, Louisiana
Posts: 15
Default Thanks jesse

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
coatimundi is offline   Reply With Quote
Old 02-07-2001, 05:06 PM   #4
coatimundi
Registered User
 
Join Date: Jan 2001
Location: Lafayette, Louisiana
Posts: 15
Talking Never mind, I figured it out!

For anyone else who may have this problem, I just put the html commands outside the <?php ?> tags.

Thanks again,
coati
coatimundi is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

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


All times are GMT. The time now is 05:30 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.