# Flash ignoring vars sent from PHP!

**URL:** <https://forum.kirupa.com/t/flash-ignoring-vars-sent-from-php/46574>\
**Category:** Uncategorized\
**Created:** [March 25, 2004, 7:55pm UTC](https://forum.kirupa.com/t/flash-ignoring-vars-sent-from-php/46574 "2004-03-25T19:55:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveD](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@SteveD](https://forum.kirupa.com/u/SteveD)\
**Post date:** [March 25, 2004, 7:55pm UTC](https://forum.kirupa.com/t/flash-ignoring-vars-sent-from-php/46574/1 "2004-03-25T19:55:27Z")

</div>

Hi,  
I am having a serious prob getting flash to read a var sent by php, there is a thread [HERE](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=51162) that addresses the same problem, but after following that I still cannot get the thing to work, so without further ado her is my code

```php

<?php
include("connect_1.php");

$pWord = $_POST['pWord'];

$query = "SELECT name,entryCount FROM $table WHERE pWord = '$pWord'"; 
$result=mysql_query($query); 
if(mysql_num_rows($result)){ 
      $row=mysql_fetch_array($result); 
      $name=$row['name']; 
      $entryCount = 1;

      echo '&name=' . urlencode($name);
      print '&entryCount='.urlencode($entryCount);
} 
else
{
    $entryCount = 2;
    echo '&entryCount='.urlencode($entryCount);
} 
mysql_close($link);
?>

```

All the above works well the DB is read and the vars are passed back to Flash - I have used dtb’s and trace to check this  
My Flash code is  
[AS]  
function bsReg()  
{  
entryLVs = new LoadVars()  
entryLVs.pWord = pWord.text;  
entryLVs.onLoad = function(success)  
{  
if(success)  
{

name = this.name;  
entryCount = this.entryCount;  
//this if statement is being complmetely iignored  
if(entryCount == 1)  
{  
//do something  
}  
else if(entryCount == 2)  
{  
//do something else;  
}

}  
}  
entryLVs.sendAndLoad(“scripts/BSentry.php”, entryLVs, “POST”);  
}[/AS]

Anyway thats about it, simple enough, nothing complicated, but the if statement is just not being read, I have tried everything and it is driving me nuts, any help greatly appreciated

Cheers

SteveD
