1 Replies - 1320 Views - Last Post: 17 June 2008 - 01:56 AM

#1 designyrsite  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 28-February 07

Need help in sending data from flash to PHP

Post icon  Posted 28 February 2007 - 08:39 AM

I have made a quiz in flash, also tried the code putting it on the button the script was working but don't kown what happen. i want flash to send my input text data to php. n continue to next slide. and in end when i click on the link that php page gets open but the data is not seen in php.

below is the code which i have put in flash on sumbit
on (release, keyPress "<Enter>") 
{
	var myVars:LoadVars = new LoadVars();
	myVars.variable1 = "name";
	myVars.send("certificate.php","POST");
		gotoAndStop(4);
}

"name" is my instance of inputtext.

and this code is written in php :
 <?php 
		 
// Receiving the variables.
$name = $_POST['name'];

// Printing out the variables.
		echo  $name;

?>		





i don't want the php page to open in middle i want it to open in the end link.

do help me.

Is This A Good Question/Topic? 0
  • +

Replies To: Need help in sending data from flash to PHP

#2 basitjee  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 17-June 08

Re: Need help in sending data from flash to PHP

Posted 17 June 2008 - 01:56 AM

this code will work and it is receiving data in PHP from Flash.I amend your code like this.

here is .fla file
[code]
on (release) {
var myVars:LoadVars = new LoadVars();
myVars.name = "it is working";
myVars.send("certificate.php","POST");
}


here is .php file
[code]
<?php
// Receiving the variables.
$name = $_POST['name'];
// Printing out the variables.
echo $name;
?>


Explanation:
I just place name of instance with myVars.in this example it is "name"
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1