-
Flash Sending Variables to PHP
I am posting this for a friend. Ok, well I have a flash movie that is sending variables to a php script, and the php script will not receive the variables $user and $pass from the user.text and pass.text input feilds. If you need to test the username and pass you can use the following:
Username:flashkit
Pass:flashkit
I have included the .fla.
Thanks in advance for your help, it is greatly appreciated.
The PHP script is:
Code:
<?php
define('HOST', 'localhost');
define('USER', '****');
define('PASS', '****');
define('DB', '****');
mysql_connect(HOST, USER, PASS);
mysql_select_db(DB);
$result = mysql_query("SELECT COUNT(*) AS numfound FROM members WHERE username='".$user."' AND password='".$pass."'");
$result_ar = mysql_fetch_array($result);
if($result_ar['numfound'] < 1)
{
?>
success=0
<?
}
else
{
?>
success=1
<?
}
?>
Here is the .fla
Last edited by rctroub; 12-28-2005 at 01:20 AM.
-
up to my .as in code
I haven't opened your fla....have a feeling it's not needed.
You are not picking up the POST's from the flash in your php but you reference them in the query:
$user."' AND password='".$pass."
Define them above in the php:
$user = $_POST["user"]; //or whatever your post value for user is named
$pass = $_POST["pass"]; //or whatever your post value for password is
-
When doing what you said, it still does not attach the variables. Any other help would wonderful. Thanks a bunch!
-
up to my .as in code
Then it's your Flash syntax. I jumped off the Flash wagon at MX2004 and use something else for Flash 8 code. Someone else will have to offer to bugcheck your Flash FLA who has actual Flash 8.
-
Ok, well thanks for trying. As I said, I am posting this op for a friend, and would appreciate any help.
-
Senior Member
Did you copy swf to same directory where your php file is? They should be both in same place. Then call php without the full path:
senderLoad.sendAndLoad("test.php",receiveLoad);
-
remember that flash will send using the get method if you are testing in auth program, it wont use post method till u run it separately...
.. thought id say that 'cause ive fallen for that mistake before
theres cheap, theres good and theres quick, but you can only have two at a time
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|