In this example we will automatically activate the user
IMPORTANT:
Do not use this example as is. Here we do not validate anything. In your application you should validate the data first, but you don't have to addslashes() as the class does this operation.
http://phpUserClass.com
*/
if (!empty($_POST['username'])){
//Register user:
require_once'access.class.php';
$user = newflexibleAccess();
//The logic is simple. We need to provide an associative array, where keys are the field names and values are the values :)
$data = array(
'username' => $_POST['username'],
'email' => $_POST['email'],
'password' => $_POST['pwd'],
'active' => 1
);
$userID = $user->insertUser($data);//The method returns the userID of the new user or 0 if the user is not added
if ($userID==0)
echo'User not registered';//user is allready registered or something like that