Hi all,
I have a problem, that has been perplexing me for days of staring at the
screen. It concerns using PHP with flash. What has come refreshin whilst
learning php intergration with flash, is that i understnad how it works...which
is a first!...lol
i understand, that you echo('') a message back from the php page to tell flash
a particlar result, but i just cannot work out, why the information isnt being
sent back to flash.. Idealy i wish to use SendAndLoad, but because that doesnt
take you to a browser page, i am using Load instead, to when i go to the
destination PHP page, i can check out visually whether the page is being
accessed correctly.
My flash code is as follows:
_root.loggedIn=false;
sym.onEnterFrame=function()
{
_root.LoginApplication.Login.submit.onPress = function()
{
this._parent.username.text="test";
this._parent.pass.text="";
//connect to database
var ab = new LoadVars ();
ab.username = "test";
ab.pass = this._parent.pass.text;
//ab.onLoad= validate;
//ab.sendAndLoad ('
http://www.jsten.com/ab.php', ab, "POST");
ab.send("
http://www.jsten.com/ab.php", "POST");
function validate()
{
trace("hi");
if(this.output=='success')
{
trace("success");
sym._alpha=0;
}
if (this.output=="fail")
{
sym._alpha=0;
}
}
}
}
and simply on the psp page i have
<?php
session_start();
if ($_REQUEST['username']=='test' && $_REQUEST['pass']=='test')
{
echo 'output=success';
echo("The Php page has been connected correctly'
$_SESSION['flashanttestlogin']=TRUE;
}
else
{
echo 'output=fail';
$_SESSION['flashanttestlogin']=FALSE;
}
?>
I would be most apreciative is somone could have a look, and maybe shed a
little light on why this is not connecting correctly, and if i enter the
username 'test' and the password 'test' why PHP isnt seeing this, and thus
printing the meesage out.
Cheers,
Steve