Курсовая работа: Разработка сайта. Система поиска по сайту

elseif (strlen ($_POST ['password']) ==32) return 0;

else

{

setcookie ($term_paper ['script'] ['prefix']. "password",md5 ($_POST ['password']));

$_COOKIE [$term_paper ['script'] ['prefix']. "password"] =md5 ($_POST ['password']);

return 1;

}

}

function CheckAdminPassword ($password)

{

global $term_paper;

$PasswordFile=term_paper_read_file (". /inc/password. inc. dat");

if (! isset ($password)) return 0;

elseif (! isset ($PasswordFile [0])) return 0;

elseif (strlen ($password) ==32&&isset ($_COOKIE [$term_paper ['script'] ['prefix']. "password"]) &&$_COOKIE [$term_paper ['script'] ['prefix']. "password"] ==$PasswordFile [0]) return 1;

elseif ($password==$PasswordFile [0]) return 1;

elsereturn 0;

}

if (CheckPostRequest ()) $term_paper ['access'] =CheckAdminPassword ($_COOKIE [$term_paper ['script'] ['prefix']. "password"]);

else$term_paper ['access'] =CheckAdminPassword ( (! isset ($_COOKIE [$term_paper ['script'] ['prefix']. "password"]))? null: $_COOKIE [$term_paper ['script'] ['prefix']. "password"]);

if (empty ($term_paper ['access']))

{

if (isset ($_POST ['password'])) $term_paper ['status'] ="парольнеопознан, повторитеввод";

$term_paper ['section'] ['name'] ="Входвуправление";

$term_paper ['result'] ='<br><table border="0" align="center" cellspacing="0" cellpadding="1">

<form method="post">

<tr><td align="right"><font face="verdana" size="1" color="maroon">Пароль: </td><td><input type="password" name="password" size="30" class="name" onfocus="id=className" onblur="id=\'\'"" style="font: italic; width: 165px" value=""></td></tr>

<tr><td height="10"></td></tr>

<tr><td align="right" colspan="2">

К-во Просмотров: 651
Бесплатно скачать Курсовая работа: Разработка сайта. Система поиска по сайту