Page 1 of 1

Simple login page for a project using PDO to connect with PHPBB

Posted: Thu Jul 25, 2019 11:30 am
by Durbatuluk
Hello, lets make some setup here:

1) Lets make a simple login page in PHP using PDO extension like that:

Code: Select all

$db_users = new PDO('mysql:host=127.0.0.1;dbname=users;charset=UTF8', 'root', 'password');
$auth = new Login;

Code: Select all

$stmt = $db_users->prepare("INSERT IGNORE INTO account (username, sha_pass_hash, email, locked) VALUES (:name, :pass, :email, 1)");
              $stmt->bindValue(':name', $name, PDO::PARAM_STR);
                  $stmt->bindValue(':pass', $pass, PDO::PARAM_STR);
                  $stmt->bindValue(':email', $email, PDO::PARAM_STR);
                  $results = $stmt->execute();
How can I implement into this simple PHP registration script also PHPBB users INSERT script? What do I need? I have the main registration script in root folder and forum in forum folder in the same machine on Linux system.

1) How to implement it inside the script?
2) How would look like the password change script?
3) Can I copy with some SQL query all users which were already registered like that into PHPBB?

Thank you.