TYPO3 CMS  TYPO3_7-6
auth_adodb_example.php
Go to the documentation of this file.
1 <?php
2 // NOTE: The ADOdb and PEAR directories MUST be in your PHP include_path!
3 require_once "Auth/Auth.php";
4 
5 function loginFunction() {
6 ?>
7  <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
8  <input type="text" name="username">
9  <input type="password" name="password">
10  <input type="submit">
11  </form>
12 <?php
13 }
14 
15 $dsn = 'mysql://username:password@hostname/database';
16 // To use encrypted passwords, change cryptType to 'md5'
17 $params = array('dsn' => $dsn, 'table' => 'auth', 'cryptType' => 'none',
18  'usernamecol' => 'username', 'passwordcol' => 'password');
19 $a = new Auth("ADOdb", $params, "loginFunction");
20 $a->start();
21 
22 if ($a->getAuth()) {
23  echo "Success";
24  // * The output of your site goes here.
25 }
Definition: ADOdb.php:17
loginFunction()