Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 02:18
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  MySQL, PostgreSQL, MS SQL, Access (Moderators: Flash-db, Musicman, Ronald Wernecke, Jorge Solis, Andries Seutens)
| | |-+  Dynamictextbox interaction with PHP and MySQL
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Dynamictextbox interaction with PHP and MySQL  (Read 1046 times)
Michael
Server what's that
*
Posts: 5



View Profile Email
« on: 04/28/04, 07:30 »

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 Grin Grin
Logged
vesa kortelainen
Administrator
Systems Administrator
*****
Posts: 3450


View Profile
« Reply #1 on: 04/28/04, 08:03 »

Try first with this Saving-tutorial; http://www.flash-db.com/Tutorials/saving/savingData.php?page=2
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything