# Flash, Php, Oracle login help

**URL:** <https://forum.kirupa.com/t/flash-php-oracle-login-help/311470>\
**Category:** flash\
**Created:** [July 7, 2010, 5:40pm UTC](https://forum.kirupa.com/t/flash-php-oracle-login-help/311470 "2010-07-07T17:40:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khaled\_Hassan](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@Khaled\_Hassan](https://forum.kirupa.com/u/Khaled_Hassan)\
**Post date:** [July 7, 2010, 5:40pm UTC](https://forum.kirupa.com/t/flash-php-oracle-login-help/311470/1 "2010-07-07T17:40:50Z")

</div>

I am trying to send my username and password from flash to php and send back a value to the flash to make sure if you are logged in or not, but it keeps posting “Unidentified” in the output of flash and does not change my flash window

here is the flash code:  
frame 1:  
stop();

var sent:LoadVars = new LoadVars;  
var receive:LoadVars = new LoadVars;  
loadVars.nameOfVariable = valueOfVariable;  
send.Username = username.text;  
send.Password = pass.text;

/_this.onEnterFrame = function () {  
if(checklog == 1){  
\_root.gotoAndStop(2);  
}  
if(checklog == 0){  
\_root.gotoAndStop(3);  
}  
}_/

flash button:  
on (release, keyPress “\<Enter\>”)  
{

```
sent.sendAndLoad("http://localhost/Checklogin.php",receive,"POST");
receive.onLoad = function()
    {
        checklog = this.toflash;
        trace(checklog);
    }
if(checklog == 1)
    {
        gotoAndPlay(3);
    }
else if(checklog == 0)
    {
        gotoAndPlay(4);
    }

```

}

Php code:  
\<?PHP

$usern = $\_POST[‘Username’];  
$passs = $\_POST[‘Password’];

$connection = oci\_connect(‘system’, ‘rms2010’, ‘ORACLE’);  
if (!$connection)  
{  
echo (“Couldn’t make a connection!”);  
exit;  
}  
if ($connection)  
{  
echo (“connected”);  
}

$sql = “SELECT COUNT(\*) AS num\_rows FROM CUSTOMER WHERE CUSTOMER\_ID = ‘$usern’ AND CUSTOMER\_PASSWORD = ‘$passs’”;  
$sql\_statement = oci\_parse($connection,$sql);  
oci\_define\_by\_name($sql\_statement,“NUM\_ROWS”,$num\_rows);  
oci\_execute($sql\_statement);  
oci\_fetch($sql\_statement);

if ($num\_rows == 1)  
{  
echo urlencode("&toFlash = 1");  
}  
else if($num\_rows == 0)  
{  
echo urlencode("&toFlash = 0");  
}  
//print ($num\_rows);

oci\_close($connection);

?\>

If anyone can help please reply.
