Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Kas blogai kode?

Parašė Erikas.· 2011 Kov. 6 12:03:08
#1

kas blogai siame kode?


<?php
 
$users = array('admin' => 'adminpass', 'guest' => 'passas')'
 
function exist($users, $name, $pass)
{
foreach ($users as $username=>$password)
if ($username === $name && $password === $pass)
return TRUE;
return FALSE;
}
 
if (!isset($_SERVER['PHP_AUTH_USER']) || !exist($users, $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']))
 
{
authenticate();
}
 
else
{
echo sprintf ("Suvesta - %s:%s", $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
}
?>


Meta klaida 13 eilutei..