PHP Classes

File: examples/extended-example.php

Recommend this page to a friend!
  Classes of Tony  >  twzAuth  >  examples/extended-example.php  >  Download  
File: examples/extended-example.php
Role: Example script
Content type: text/plain
Description: example script
Class: twzAuth
Authenticate users using HTTP Basic authentication
Author: By
Last change:
Date: 7 years ago
Size: 1,273 bytes


Class file image Download
    Example - basic entry page for twzAuth (extended mode)
    Only valid, authenticated users can view this page.
    Admin users will get a link to admin.php

// clumsy "logout" (for testing only)..
    { unset(


<html lang="en">
    <title>twzAuth (extended mode)</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <style> form { display:inline; } </style>

<h2>Welcome <?php echo $Username; ?></h2>
<p>If you can see this page, you have authenticated successfully in <b>extended mode</b>.</p>

    { echo
'<p><a href="extended-admin.php">User admin</a></p>'; }


<div>There is no "logout" facility with HTTP authentication (except <br />
    by restarting the browser). For testing purposes you can <br />
    click <form method="post"><input type="submit" name="logout" value="&quot;logout&quot;" /></form>,
    and then cancel the subsequent dialog.</div>

<p><a href="./">home</a></p>


For more information send a message to info at phpclasses dot org.