Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how do i Send data from flash to php to database

4 views
Skip to first unread message

theshak06

unread,
Mar 28, 2009, 1:22:53 PM3/28/09
to
Hi,
Can anyone give me a simple tutorial on how to send data from a flash to a
database and how the receive it aswell. Im presuming you pass the data from the
flash to a php file to the database when sending and call the data using a php
file to the database aswell. What im trying to do is just have a button that
will increment a number in a database by 1 and then display that information on
a different Frame within the flash later.

Basically what i want to do if have a button pressed to increment a number in
a database.

Hope you can help as i would be very greatful .

Peter

NedWebs

unread,
Mar 28, 2009, 1:47:58 PM3/28/09
to
Visit http://www.gotoandlearn.com and look for a tutorial there.

DMennenoh **AdobeCommunityExpert**

unread,
Mar 29, 2009, 1:24:17 PM3/29/09
to
Yes, you send to PHP, and PHP does the database work. You want to use the
LoadVars class' sendAndLoad method to do it.

If you have a php page on your server, you do something like so in Flash:

var rv = new LoadVars(); //for receiving the result
rv.onLoad = function(success:Boolean){
trace(this["ok"]);
}
var sv = new LoadVars(); //for sending to php

sv.inc = 1;

sv.sendAndLoad("someDomain.com/myphpfile.php", rv);

then in your myphpfile.php you would do like so:

<?php
$inc = $_REQUEST['inc'];

if($inc == '1'){
//do the inc

}

echo "&ok=1"; //send ok back to flash

?>

--
Dave -
www.offroadfire.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


0 new messages