# Send data to a URL

**URL:** <https://forum.kirupa.com/t/send-data-to-a-url/63703>\
**Category:** Uncategorized\
**Created:** [September 9, 2004, 9:27am UTC](https://forum.kirupa.com/t/send-data-to-a-url/63703 "2004-09-09T09:27:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![who](https://avatars.discourse-cdn.com/v4/letter/w/cdc98d/32.png) [@who](https://forum.kirupa.com/u/who)\
**Post date:** [September 9, 2004, 9:27am UTC](https://forum.kirupa.com/t/send-data-to-a-url/63703/1 "2004-09-09T09:27:09Z")

</div>

[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]

```auto
 [/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]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 11:10am UTC](https://forum.kirupa.com/t/send-data-to-a-url/63703/2 "2004-09-09T11:10:01Z")

</div>

try sendAndLoad() instead ?

or update your flash file here

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 11:57am UTC](https://forum.kirupa.com/t/send-data-to-a-url/63703/3 "2004-09-09T11:57:53Z")

</div>

> [@who](#):
>
> [font=Arial]  
> [font=Arial] my\_lv.send(“[http://myURL](http://myURL)”, “POST”);[/font]  
> [font=Arial][/font][/font]

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:

```auto

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

```

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 13, 2004, 3:21pm UTC](https://forum.kirupa.com/t/send-data-to-a-url/63703/4 "2004-09-13T15:21:23Z")

</div>

> [@RedSox](#):
>
> ```auto
> 
> my_lv.send("http://myURL", "_blank", "POST");
> 
> ```

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

I’ll try with XML…

Thanks everybody…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 13, 2004, 4:31pm UTC](https://forum.kirupa.com/t/send-data-to-a-url/63703/5 "2004-09-13T16:31:37Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 13, 2004, 5:40pm UTC](https://forum.kirupa.com/t/send-data-to-a-url/63703/6 "2004-09-13T17:40:20Z")

</div>

> [@bjory](#):
>
> I’m having the same problem too!!  
> Sorry to borrow your thread who.

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 14, 2004, 12:28am UTC](https://forum.kirupa.com/t/send-data-to-a-url/63703/7 "2004-09-14T00:28:17Z")

</div>

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](http://myURL)”,my\_recLv, “POST”);

And use my\_recLv as the object which received the data from your URL.

Hope it helps.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 15, 2004, 8:18am UTC](https://forum.kirupa.com/t/send-data-to-a-url/63703/8 "2004-09-15T08:18:43Z")

</div>

> [@bjory](#):
>
> [color=red]my\_recLv[/color] = new LoadVars();
> 
> my\_lv.sendAndLoad(“[http://myURL](http://myURL)”,[color=red]my\_recLv[/color], “POST”);
> 
> And use my\_recLv as the object which received the data from your URL.
> 
> Hope it helps.

Yes it works…

THANX… 🙂
