PDA

View Full Version : Sending vars to a PHP file... but also display these values..


mandalavillage
01-26-2008, 05:42 AM
Hello, I wonder if someone can help me in an easy way:

I have created a couple of text fields: I want to send its values to a php file which also will be display echoing these variables.. how do I achieve it ? I have been looking for some tutorials but most of them only show how to pass vars in order to send a mail.... which is not the case now... I want to display values and keep working with them... this is a small reservation system where I want to send the "check in" and "check out" values...

Thanks in advance...!

sneakyimp
02-22-2008, 11:14 PM
I'm not sure why you would want PHP to send back any values that it had just received because they will still be in those text fields on Flash, won't they?

At any rate, you probably know how to see what variables have been supplied to a PHP script based on this other tutorials. The way that you send back information from PHP is to echo a url string with urlencoded values. Something like this:

// set the variables to return from php
$myName = 'Joe Schmoe';
$myOccupation = 'PHP Master';

// create the response query string
$response = '';
$response .= '&myName=' . urlencode($myName);
$response .= '&myOccupation=' . urlencode($myOccupation);

// send the response back to the requestor
echo $response;


The way you access that information in flash depends on whether you are using Actionscript 2 or Actionscript 3. Check the flash documentation for that.