Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
stefan.bund #1
Simple INSERT into mysql via PHP and LoadVars send()
I have been trying to get a flash to do a database insert into mysql,
using a php script on my webserver:
<?php
$firstname = $_POST["firstname"];
$lastname = $_POST["lastname"];
$middlename = $_POST["middlename"];
$password = $_POST["password"];
$email = $_POST["email"];
$birthdate = $_POST["birthdate"];
$country = $_POST["country"];
$county = $_POST["county"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip = $_POST["zip"];
$screenname = $_POST["screenname"];
$dbh = mysql_connect("localhost", "********", "******") or die ('I
cannot connect to the database because: ' . mysql_error());
mysql_select_db("****_******");
mysql_query('INSERT INTO userTable (county, firstName, middleName,
screenName, password, email, city, lastName, birthDate, zip, country,
state) VALUES ("'. $county .'", "' . $firstname . '", "' . $middlename
.. '", "' . $screenname . '", "' . $password . '", "' . $email . '", "'
.. $city . '", "' . $lastname . '", "' . $birthdate . '", "' . $zip .
'", "' . $country . '", "' . $state . '")', $dbh);
?>
I have the following AS written in a movie clip with one layer, and one
symbol, containing the text input boxes, labels, and button:
import mx.remoting.*;
import mx.rpc.*;
//import mx.remoting.debug.NetDebug;
import mx.utils.Delegate;
import mx.controls.Alert;
var submitListener:Object = new Object();
submitListener.click = function(evt:Object):Void {
var myVars:LoadVars = new LoadVars();
myVars.lastname = _level0.instance1.txtLastName.text;
myVars.firstname = _level0.instance1.txtFirstName.text;
myVars.middlename = _level0.instance1.txtMiddleName.text;
myVars.password = _level0.instance1.txtPassword.text;
myVars.email = _level0.instance1.txtEmail.text;
myVars.birthdate = _level0.instance1.txtBirthdate.text;
myVars.country = _level0.instance1.txtCountry.text;
myVars.county = _level0.instance1.txtCounty.text;
myVars.city = _level0.instance1.txtCity.text;
myVars.state = _level0.instance1.txtState.text;
myVars.zip = _level0.instance1.txtZip.text;
myVars.screenname = _level0.instance1.txtScreenName.text;
myVars.send("http://thegameofaphrodite.com/UserCreation.php");
this.lbl_message.text = "ok";
};
_level0.instance1.btnUserCreation.addEventListener ("click",
submitListener);
It also appears online at
[url]http://thegameofaphrodite.com/userCreation.swf[/url]
Thanks very much, must get this to work
stefan.bund Guest
-
LoadVars-using send to pass a variable from flash to php
For the life of me, I've tried everything: I've researched LoadVars on Adobe forum, used David Powers' books, googled 'flash to php', LoadVars,... -
Problems with LoadVars.send and Firefox
There seems to be a problem with Firefox 2.x sending variables to PHP scripts with the LoadVars.send/POST method. <br> The same problem doesn't... -
Flash to CFM via loadvars.send()
Does anyone know when you use loadvarsObj.send("index.cfm","_blank","post") which scope the variables are presented to CF in? I had assumed that... -
Loadvars,Loadvariables, Loadvarablesnum - simple
Hi, Sorry to bother you all with this. I am expanding my skillset into Flash (i have been a programmer for 20 years in many other languages), and... -
Simple PHP & MySQL Insert Statement Does Not Work
Hello, I'm having a bear of a time figuring out why a simple PHP/MySQL insert is causing a parse error when trying to insert static data, and no...



Reply With Quote

