Send data to a URL

[font=Arial]I would like to send some data, from an input field and some dynamic fields without opening an new page or replace the existence…to a URL…[/font]
[font=Arial]I tried this….[/font]
[font=Arial]

 [/font][font=Arial][font=Arial]function sendForm() {[/font]
[font=Arial]	my_lv = new LoadVars();[/font]
[font=Arial]	my_lv.baseId = _parent.baseId_text.text;[/font] 
[font=Arial]	my_lv.send("http://myURL", "POST");[/font] 
[font=Arial]}[/font]
 
[font=Arial]send_btn.onRelease = function() {[/font] 
[font=Arial]	if (baseId_text.text == "") {[/font] 
[font=Arial]		status_txt.text = "Please complete the base id field.";[/font] 
[font=Arial]	} else {[/font] 
[font=Arial]		status_txt.text = "";[/font] 
[font=Arial]		sendForm();[/font] 
[font=Arial]	}[/font] 
[font=Arial]};[/font] 

[/font]
[font=Arial]But an new browser window opened…[/font]

[font=Arial]Please, I need your help…[/font]
[font=Arial]Thanks in advance[/font]

try sendAndLoad() instead ?

or update your flash file here

The parameters for the send method above are:
(url, target, method), while yours only has (url, method).

What you could do is include a second parameter like _blank, _parent, _self or _top (I can’t exactly figure out what you want to do).

so for instance your send method should look like:


 my_lv.send("http://myURL", "_blank", "POST");
 

That should solve your problem I think. If it doesn’t please let me know :slight_smile:

_black… Opens new browser window, new page, something that I don’t want…

I’ll try with XML…

Thanks everybody…

I’m having the same problem too!!
Sorry to borrow your thread who.

Heres my code:

[COLOR=Red]myData = new LoadVars();
myData.Gender = “M”;
myData.ExID = 1;
myData.send(“getexercise.php”);

myData.onLoad = function (success) {
trace(this._path) // will output “_level0"
if (success) {
trace (” variables loaded ");
trace(myData.MuscleDesc0);
myName.text = myData.MuscleDesc0;

} else {
    trace (" Error loading variables "); 
}

}
[/COLOR]

what happens is. it opens a new window and on my output window, it doesn’t even show whether if the “variables loaded” or “Error loading variables”. Its blank. Some do help.

And how can I get the data out from the php script below:

[COLOR=Blue]<?php
require_once("…/class/clsExerciseEducation.php");

$theEx = new ExerciseEducation;

if(isset($_GET[‘Gender’]) && isset($_GET[‘ExID’]))
{
$result = $theEx->getExercise($_GET[‘Gender’], $_GET[‘ExID’]);
$c = 0;
while($row=mysql_fetch_array($result)){
echo “MuscleDesc$c=$row[muscle_description]&Name$c=$row[name]&ExID$c=$row[ex_id]&”;
$c++;
}
echo “c =$c”;
}
?>[/COLOR]

Many thanks!

:slight_smile: … I hope that we will have a solution because I becoming carzy…

Hey I figured out using sendAndLoad function could help.

what you do in ur Flash is:

my_lv = new LoadVars();
my_recLv = new LoadVars();

my_lv.baseId = _parent.baseId_text.text;
my_lv.sendAndLoad(“http://myURL”,my_recLv, “POST”);

And use my_recLv as the object which received the data from your URL.

Hope it helps.

Yes it works…

THANX… :slight_smile: