PDO
is not a different language. It is a PHP extension used to connect and operate on a datasource.
You can use filter_input(INPUT_POST, 'username')
without a problem in the code you have there.
$stmt = $db->prepare('INSERT INTO members (username,password,email,active) VALUES (:username, :password, :email, :active)');
$stmt->execute(array(
':username' => filter_input(INPUT_POST, 'username'),
':password' => $hashedpassword,
':email' => filter_input(INPUT_POST, 'email'),
':active' => $activasion
));
This should work just fine, but I don’t see why you can’t just access $_POST
directly, can’t se a problem with it.
1
solved how to acces super variable $_POST in PDO