Hi there....
I'm just starting to learn PHP...and know a little actionscripting...but this freaks me out....!!!
It's probably done a million times but I cannot get this to work...
(feeling very very stuppid at the moment)
I'm building a website embedded in a .swf file. Part of the site is restricted and can only be accessed via a login (this works with php. and MySQL) When someone logs in he fills in a username and password, is its ok then he/she's logged in....(sofar this all works nicely)
When logged the person is welcomed onto the private section of the movieclip. (still works here...)
What i don't seem to get working is to retreive the info from the php-file, so I can display his/her in a dynamic-textbox
As you can see I stated (hopefullt right??) in the php file to print the value user
print "user=$user"
Am I correct to say that the Actioncode in the frame should retreive that printout like this, or am i missing code here?
And if yes...when the VAR of the dyn-textbox is set to (user) then why doesn't it show who's logged in at that time...?
I'm really trying to understand this because lateron in the development I want to get more info posted trough flash from the logged in user, so he/she can see his/her personal information....like howmany time he/she logged in etc.etc.
Can someone please help me out here??
################################################
here is the code from the php-file....
################################################
<?
//this pulls the variables from the flash movie when the user
//hits submit. Use this when your global variables are off.
//I don't know how to toggle global variables, so I just put
//it in all the time
$user=$_POST['user'];
$pass=$_POST['pass'];
//connect to database
if ($user && $pass){
mysql_pconnect("192.168.0.1","root","sola1368") or die ("didn't connect to mysql");
mysql_select_db("auth") or die ("no database");
//make query
$query = "SELECT * FROM auth WHERE username = '$user' AND userpassword = '$pass'";
$result = mysql_query( $query ) or die ("didn't query");
//see if there's an EXACT match
$num = mysql_num_rows( $result );
if ($num == 1){
print "status=You're in&checklog=1";
} else {
print "status=Sorry, but your user name and password did not match a user name/password combination in our database. Usernames and passwords are entered in from a different file. Thank you for visiting test login script!!&checklog=2";
// Database query code goes here.
$fullName = // result of database query;
print "&user=$user";
}
}
?>
##############################################
And here the code from the frame with the embedded dyn-textbox
##############################################
loadVariablesNum =("newlogin.php", 0, "GET");
##############################################
The dyn-textbox has the following properties:
Dynamic text
Single Line
Var: user
Not selecteble
name = useroutput
The .swf file and the .php file are in the same dir on my server and the login procedure really works wel...so I guess that I'm the screwup.... doing something wrong with the action-code.
Please help...
Thanx a million
