Auth_HTTP
[ class tree: Auth_HTTP ] [ index: Auth_HTTP ] [ all elements ]

Source for file test_digest_post.php

Documentation is available at test_digest_post.php

  1. <?php
  2. require_once "Auth/HTTP.php";
  3. define('DSN','sqlite://dummy:@localhost//tmp/user.db?mode=0644');
  4.  
  5. $options = array('dsn'=>DSN'authType'=>'digest');
  6. $auth = new Auth_HTTP("DB"$options);
  7.  
  8. $auth->setRealm('dummy''sample');
  9. $auth->start();
  10.  
  11. ?>
  12. <html>
  13. <head><title>HTTP digest authentication for POST method</title></head>
  14. <body>
  15. <?php
  16. if($auth->getAuth()) {
  17.   print <<<EOS
  18. <form action="{$_SERVER['PHP_SELF']}" method="post">
  19. <input type="text" name="title" value="php5" />
  20. <input type="submit" />
  21. </form>
  22. EOS;
  23. }
  24. if (!empty($_POST['title'])) {echo 'POST:Title: '.$_POST['title'].'<br>';}
  25. if (!empty($_GET['foo'])) {echo 'GET:foo: '.$_GET['foo'].'<br>';}
  26. print "METHOD: ".$_SERVER['REQUEST_METHOD']."<br>";
  27. ?>
  28. </body></html>

Documentation generated on Mon, 11 Mar 2019 15:47:23 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.