# Problem loading vars to flash from php

**URL:** <https://forum.kirupa.com/t/problem-loading-vars-to-flash-from-php/307668>\
**Category:** flash\
**Created:** [April 7, 2010, 11:53pm UTC](https://forum.kirupa.com/t/problem-loading-vars-to-flash-from-php/307668 "2010-04-07T23:53:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![herzeis](https://avatars.discourse-cdn.com/v4/letter/h/f475e1/32.png) [@herzeis](https://forum.kirupa.com/u/herzeis)\
**Post date:** [April 7, 2010, 11:53pm UTC](https://forum.kirupa.com/t/problem-loading-vars-to-flash-from-php/307668/1 "2010-04-07T23:53:49Z")

</div>

Hello all,

I have tried repeatedly to sendAndLoad variables from/to flash and php.

The problem actually comes when passing the variables from php to flash, here is the flash code:

var dataOut:LoadVars = new LoadVars();  
var dataIn:LoadVars = new LoadVars();

```
dataOut.username = _level0.usuario.ss.s1; //passing the value of textbox
 dataOut.pass = _level0.contrasena.ss10.s10; //passing the value of textbox

 dataOut.sendAndLoad("http://www.itnmexico.com/Pag%20Pstventa/newlogin.php", dataIn, "POST");

```

\_level0.estatus=“Por favor espere…”; //displaying info to the user

dataIn.onLoad = function() {  
if (this.valid==“1”) {  
\_level0.estatus = ‘Bienvenido’ + this.Name;

import com.greensock.\*;  
TweenMax.to(\_level0.usuario, 1, {\_x:1000, \_alpha:0});  
TweenMax.to(\_level0.contrasena, 1, {\_x:1000, \_alpha:0});  
TweenMax.to(\_level0.ww, 1, {\_x:1000, \_alpha:0});

```
  } 
else {

```

\_level0.estatus = this.retro;  
}

}

the php code is the following:

\<?php

$usuario=$\_POST[‘username’];  
$contrasena=$\_POST[‘pass’];  
$num=1;  
if($num==2){  
echo 'valid=1&Name= '.$Nombre;  
}  
else {  
echo ‘valid=0&retro=Usuario o contraseña inválidos.’;  
}

?\>

I have ommited some mysql code, but it would still work this way.

Which is most odd is that when I test the movie in my computer it works perfectly, but when I upload it to the server it doesn’t work anymore.

Please help!!!

Thanks.
