Calling session (user)
hi guys,
i want display user name in dynamic textfield on login success page (new page) keeps giving me 'undefined'. what's problem?
login.php
<?php
session_start();
$username = $_post['username'];
$password = $_post['password'];
$_session['username'] = $username;
. //other codes
.
.
?>
adminpage.php (successpage)
<?php
session_start();
$_session['username'] = $_post['username'];
$username = $_get['username'];
print "session=$username";
?>
as3
import flash.display.*;
import flash.events.*;
import flash.net.urlloader;
import flash.net.urlrequest;
import flash.net.urlvariables;
import flash.net.urlloaderdataformat;
import flash.net.urlrequestmethod;
var phpvarssession:urlvariables = new urlvariables();
var phpfilerequestsession:urlrequest = new urlrequest("adminpage.php");
phpfilerequestsession.method = urlrequestmethod.post;
var phploadersession:urlloader = new urlloader();
phploadersession.dataformat = urlloaderdataformat.variables;
phploadersession.addeventlistener(event.complete, showsession);
phpvarssession.user = user.text;
phpfilerequestsession.data = phpvarssession;
phploadersession.load(phpfilerequestsession);
function showsession(event:event):void
{
user.text = "" + event.target.data.session;
}
use:
adminpage.php (successpage)
<?php
session_start();
$_session['username'] = $_post['username'];
$username = $_post['username'];
print "session=$username";
?>
More discussions in ActionScript 3
adobe
Comments
Post a Comment