• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 559
  • Last Modified:

How can I send data to database via Flash using XML?

Hello Experts,

I would like to have a form within my flash file to pass the field data to a database table. Form has on two fields:

First Name
Last Name

Submit Button

How can I pass this information on to the database table. I am able to read the data via XML but have no clue how to write it DB. Any help would highly be appreciated.

Thanks a lot.
  • 3
1 Solution
RobOwner (Aidellio)Commented:
You will need to use a server side script or flash remoting.  Are you currently using PHP, coldfusion, etc?
RobOwner (Aidellio)Commented:
When using a server side script you would use the following code.  You would be able to acccess the two variables in your server side script (first_name and last_name), connect to your backend database and upload the values

var submitListener:Object = new Object();
submitListener.click = function(evt:Object) {
	var result_lv:LoadVars = new LoadVars();
	result_lv.onLoad = function(success:Boolean) {
		if (success) {
			result_ta.text = result_lv.welcomeMessage;
		} else {
			result_ta.text = "Error connecting to server.";
	var send_lv:LoadVars = new LoadVars();
	send_lv.first_name = name_first.text;
	send_lv.last_name = name_last.text;
	send_lv.sendAndLoad("http://www.your-domain.com/serverscript.php",result_lv, "POST");

Open in new window

combustion007Author Commented:
Thank you so much for you help. I would like to use MS ACCESS to set up the testing environment and for production, will be using MS SQL. I don't want to use loadvar because security is very important that is why I exploring XML for the task.

Appreciate all the help.
RobOwner (Aidellio)Commented:
There shouldn't be any security risks using loadVars and the POST method... no more than XML.  LoadVars would be a lot easier to use initially anyway.

sounds like you will be using windows / iis so your server side script will probably ASP which will integrate nicely with MS ACCESS or MS SQL.

Let me know if there is anything else I can help you with
what would the server side script look like? do you have an example to send updated variables?

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now