-
Ok. What I tested was
Code:
<?php
session_start();
$name = "Nick";
$receiver = "John";
$_SESSION ['name']=$name;
$_SESSION['receiver']=receiver;
if($name=="" || $receiver=="") {
echo "error";
} else {
echo "ok";
$_SESSION ["name"] = $name;
$_SESSION ["receiver"] = $receiver;
}
?>
So now I should remove the four lines near the top, and uncomment
// $name = "Nick";
//$receiver = "John";
From within? P.s. I removed the first if statement from the original file, because with it their, it would never enter the statement as it requite an event.
-
yes remove and uncomment what think ............................removing the if stament is fine you could probably even remove the remaining if statement and acheive a good result.
-
Ok, so that seems to be working exactly the same as above.
-
well i've determined that php is setting the data.....the only thing i can't see is that flash is receiving the data which it probably isn't since the text fields are null......i can't do much more unless you can get it all to work within the flash IDE where we can set some traces.
-
Your help is so much appreciated, seriously your a star. I have found something quite strange. So, I set it back to this
Code:
<?php
session_start();
$name = $_POST["name"];
$receiver = $_POST["receiver"];
if($name=="" || $receiver=="") {
echo "error";
} else {
echo "ok";
$_SESSION ["name"] = $name;
$_SESSION ["receiver"] = $receiver;
}
?>
So that it works with post. I then try it through my webpage, I enter details into the form, and get transfered to the second swf. I get the null error, but then if I open a new tab, and load my second php file in it, it echos like before the params I have entered into the field in the first swf. So, it appears the data is getting to the second php file. So, I would assume the issue is with my as3 in my second swf.
So I dont know if I retrieving the data correctly from within this, or placing it in the text field correctly?
-
I concurr that your first swf is working....................................in your second swf this
PHP Code:
request.method = URLRequestMethod.GET;
line should be
PHP Code:
request.method = URLRequestMethod.POST;
......I think I always use post....not sure though but its something to try.
-
What a silly error. When I was calling the names in my as3 file, I was using the ones set in my first php
Code:
var nameF = evt.target.data.name;
var receiverF = evt.target.data.receiver;
When what was needed was the echoed variables
Code:
var nameF = evt.target.data.nameF;
var receiverF = evt.target.data.receiverF;
A long time coming, but now it all works perfectly. I dont know whether to laugh or cry!
Anyways, once again, thank you so much for your help. I would still be stuck at the very beginning if it wasnt for you!
-
I'm happy its working.........Sounds like you learned somthing too considering you just built it and debugged it.