<?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>
|