see
for example:
http://www.actionscript.org/forums/archive/index.php3/t-89720.html
<?php
session_start();
header("Cache-control: private"); //IE 6 Fix
class Login {
var $db_host = 'localhost';
var $db_name = 'music';
var $db_user = 'login';
var $db_pwd = 'secret';
function Login() {
$this->connection = @mysql_connect($this->db_host, $this->db_user, $this->db_pwd);
@mysql_select_db($this->db_name);
$this->methodTable = array(
"checklogin" => array (
"description" => "Checks a username, password",
"access" => "remote",
"arguments" => array("user", "pass")
),
"insert" => array (
"description" => "Creates a user",
"access" => "remote",
"arguments" => array("user", "pass")
),
"update" => array (
"description" => "Updates user info",
"access" => "remote",
"arguments" => array("user", "pass")
)
);
}
function checklogin($username, $password) {
if($this->connection) {
//$password = encrypt($password);
$query = "select username from users where username = '$username' and password = '$password'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
if ($username == $row[0]) {
$_SESSION['uname'] = $username;
return true;
}
} else {
return false;
}
}
// and more .....
// and more .....