My question is: I want to enable different users to view only certain areas of the Flash piece. I've been told that I can use "ID " numbers from my sql and change the label in flash with ID Numbers.
Is this true and how can I make this work?
Here is the PHP:
Code: Select all
<?php
if(isset($_POST['user']))
{
$user = $_POST['user'];
$pass = $_POST['pass'];
mysql_connect("domain.net","domain","domain") or die ("didn't connect to mysql");
mysql_select_db("domain") or die ("no database");
$query = "SELECT * FROM auth WHERE username = '$user' && userpassword = '$pass'";
$result = mysql_query($query) or die ("didn't query");
$num = mysql_num_rows($result);
if($num == 1)
{
echo "checklog=1&status=Logged in successfully";
}
else {
echo "checklog=2&status=Insufficient username and password";
}
} else {
echo "Error";
}
?>Code: Select all
stop();
// Create 2 LoadVars objects to load and send data to the PHP script
var loader:LoadVars = new LoadVars();
var sender:LoadVars = new LoadVars();
status = "Enter your information and submit";
// When the submit button is pressed...
submit_btn.onRelease = function() {
// assign the text in the input fields to the sender object
sender.user = userinput.text;
sender.pass = passinput.text;
_parent.gotoAndStop("Success");
// and then send it on to the PHP file on the server using
// the POST method. The returned result will be caught
// by the loader object
sender.sendAndLoad("newlogin.php", loader, "POST");
}
// The loader object waits for a response from the server
// and checks for any returned variables, messages, errors.
loader.onLoad = function(success:Boolean)
{
// This boolean variable (success) will return true or false
// on whether the PHP file was retrieved
if(success)
{
// If we're here then we've successfully retrieved
// the PHP file. Lets check for a Login result
if(this.checklog == 1)
{
// This is a authorised login so show the success frame
// and show the message in the status textfield
status = this.status;
_parent.gotoAndStop("Success");
}
else if(this.checklog == 2)
{
// This is a unauthorised login so show the failure frame
// and show the error message in the status textfield
status = this.status;
_parent.gotoAndStop("Invalid");
}
}
else {
// There was a problem retrieving the PHP file
status = "Error connecting to server";
}
}http://www.actionscript.org/forums/show ... post810543
Unfortunately I have very little knowledge about all of this.
Little help and thanks in advance!
Brian