PHP Classes

File: example/auth_form.php

Recommend this page to a friend!
  Classes of Victor Bolshov   CrossAuth   example/auth_form.php   Download  
File: example/auth_form.php
Role: Example script
Content type: text/plain
Description: usage example
Class: CrossAuth
Authenticate users in multiple domains at once
Author: By
Last change:
Date: 18 years ago
Size: 966 bytes
 

Contents

Class file image Download
<?php

/**
 * CrossAuth example form
 *
 * @author vbolshov
 * @package CROSS_AUTH
 * @subpackage EXAMPLE
 */

require_once dirname(__FILE__) . '/../CrossAuth.php';
$ca = new CrossAuth();
$ca_urls = array('http://check.com/auth_check.php');

// form submitted
if (($_SERVER['REQUEST_METHOD'] == 'POST') &&
    (
$login = trim( (string) @$_POST['login'])) &&
    (
$password = trim((string) @$_POST['password'])))
{
   
$ca->setId($login);
   
$ca->setPassword($password);
}
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Auth Form</title>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FF9966" vlink="#FF9966" alink="#FFCC99">
    <form method="POST" action="">
    Login: <input type="text" name="login" />
    <br />
    Password: <input type="password" name="password" />
    <br />
    <input type="submit" />
    </form>

    <?php
   
echo $ca->getJavascript($ca_urls);
   
?>

</body>
</html>