<?php
require_once('CntrctRs.php');
$_GET=array_map('trim',$_GET);
if(isset($_GET['prefix'])){
$length=intval($_GET['length']);
$prefix=htmlspecialchars($_GET['prefix']);
$number=intval($_GET['number']);
$responsetype=(string)$_GET['responsetype'];
unset($_GET['prefix']);
unset($_GET['length']);
unset($_GET['number']);
unset($_GET['responsetype']);
$_GET=array_map('htmlspecialchars',$_GET);
$x=new FriendlyPwdSuggest($_GET,$length,$prefix,false);
if($responsetype==='json') echo $x->suggest_n($number,$responsetype);
else foreach ($x->suggest_n($number,$responsetype)as $v) echo $v.PHP_EOL .'<br>';
}else echo false;
?>
|