# Sending and loading vars to php

**URL:** <https://forum.kirupa.com/t/sending-and-loading-vars-to-php/263484>\
**Category:** flash\
**Created:** [June 16, 2008, 4:04pm UTC](https://forum.kirupa.com/t/sending-and-loading-vars-to-php/263484 "2008-06-16T16:04:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vsiege](https://avatars.discourse-cdn.com/v4/letter/v/db5fbb/32.png) [@vsiege](https://forum.kirupa.com/u/vsiege)\
**Post date:** [June 16, 2008, 4:04pm UTC](https://forum.kirupa.com/t/sending-and-loading-vars-to-php/263484/1 "2008-06-16T16:04:45Z")

</div>

I am looking to send vars out to a php script and have it return name and value pairs. I keep getting this error when i submit my form. This example doesnt work online either. Do I have this written correctly?

```php
<?php
$me = $_REQUEST["me"];
$them = $_REQUEST["them"];;
echo 'me=$me&$them=them';
?>

```

I have two traces, one to trace the vars I am sending out… the other to check the vars received. Heres how it traces out:

> SENDING = me=working&them=flash  
> TypeError: Error #2007: Parameter text must be non-null.  
> at flash.text::TextField/set text()  
> at emailSendPHP\_fla::MainTimeline/handleResponse()  
> at flash.events::EventDispatcher/dispatchEventFunction()  
> at flash.events::EventDispatcher/dispatchEvent()  
> at [flash.net](http://flash.net)::URLLoader/onComplete()

Heres my as3:

```auto
var requestMe:URLRequest = new URLRequest();
var sendMail_lv:URLVariables = new URLVariables();
// create a URLLoader to send/recieve the data
var eLoader:URLLoader = new URLLoader();
// when response is back use this event handler
eLoader.addEventListener(Event.COMPLETE, handleResponse);
// return URL-encoded vars
eLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
requestMe.method = URLRequestMethod.POST;
function launchClick(event:MouseEvent):void {
	sendMail_lv.me = "working";
	sendMail_lv.them = "flash";
	requestMe.url = sendConfirmEmailFile;

	requestMe.data = sendMail_lv;
	// send the data in the URLRequest to the server
	eLoader.load(requestMe);
	trace('SENDING = ' + requestMe.data);

}
function handleResponse(event:Event):void {
	var newVars:URLVariables = new URLVariables(event.target.data);
	bubble_mc.confirm_txt.text = eLoader.data.me;
	var loader:URLLoader = URLLoader(event.target);
	trace('RECEIVING = ' +loader.data.me);
	senderBody_txt.text = loader.data.me;
	// success
	bubble_mc.gotoAndStop("success");}

```

---

<div class="post-metadata">

**Author:** ![Alex\_Lexcuk](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@Alex\_Lexcuk](https://forum.kirupa.com/u/Alex_Lexcuk)\
**Post date:** [June 16, 2008, 6:53pm UTC](https://forum.kirupa.com/t/sending-and-loading-vars-to-php/263484/2 "2008-06-16T18:53:25Z")

</div>

example  
load data  
[http://dnadillo.dn.ua/images/imag/GaleryScoresText.php](http://dnadillo.dn.ua/images/imag/GaleryScoresText.php)  
[http://dnadillo.dn.ua/mur\_gallery/php/AC3\_PHP.swf](http://dnadillo.dn.ua/mur_gallery/php/AC3_PHP.swf)  
[http://dnadillo.dn.ua/mur\_gallery/php/GaleryScoresText.txt](http://dnadillo.dn.ua/mur_gallery/php/GaleryScoresText.txt)  
[http://dnadillo.dn.ua/mur\_gallery/php/mur\_galery\_AC3\_PHP.rar](http://dnadillo.dn.ua/mur_gallery/php/mur_galery_AC3_PHP.rar)

send data  
[http://dnadillo.dn.ua/fla/php/php.swf](http://dnadillo.dn.ua/fla/php/php.swf)  
[http://dnadillo.dn.ua/fla/php/application.txt](http://dnadillo.dn.ua/fla/php/application.txt)

[http://dnadillo.dn.ua/fla/php/php-flash-write.zip](http://dnadillo.dn.ua/fla/php/php-flash-write.zip)  
[http://dnadillo.dn.ua/fla/php/php-flash-write.txt](http://dnadillo.dn.ua/fla/php/php-flash-write.txt)

---

<div class="post-metadata">

**Author:** ![vsiege](https://avatars.discourse-cdn.com/v4/letter/v/db5fbb/32.png) [@vsiege](https://forum.kirupa.com/u/vsiege)\
**Post date:** [June 17, 2008, 6:16pm UTC](https://forum.kirupa.com/t/sending-and-loading-vars-to-php/263484/3 "2008-06-17T18:16:50Z")

</div>

thank you both for the help. I got it working. See you around.

---

<div class="post-metadata">

**Author:** ![Alex\_Lexcuk](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@Alex\_Lexcuk](https://forum.kirupa.com/u/Alex_Lexcuk)\
**Post date:** [June 18, 2008, 9:43am UTC](https://forum.kirupa.com/t/sending-and-loading-vars-to-php/263484/4 "2008-06-18T09:43:42Z")

</div>

test guest-book

[http://dnadillo.dn.ua/fla/js-swf-html/guest.swf](http://dnadillo.dn.ua/fla/js-swf-html/guest.swf)  
[http://dnadillo.dn.ua/fla/js-swf-html/guest.zip](http://dnadillo.dn.ua/fla/js-swf-html/guest.zip)  
[http://dnadillo.dn.ua/fla/js-swf-html/guest.txt](http://dnadillo.dn.ua/fla/js-swf-html/guest.txt)  
[http://dnadillo.dn.ua/fla/js-swf-html/guest-txt-info.txt](http://dnadillo.dn.ua/fla/js-swf-html/guest-txt-info.txt)  
comment: limit 500 [SIZE=2]byte[/SIZE]  
[SIZE=2]if [SIZE=2]more I deleted all message, and [SIZE=2]add new.  
[/SIZE][/SIZE][/SIZE]
