Создать форум бесплатно: ixbb.ru :: Календарь на Апрель 2024 года: calendar2008.ru/2024/aprel/

  Reply to this topicStart new topicStart Poll

закомментировать PHP код

, сделайте, пожалуйста :)
alex_shtil
Отправлено: Jun 8 2009, 12:14 AM
Quote Post


  Полковник
*

Группа: Members
Сообщений: 132
Пользователь №: 1629
Регистрация:
7-June 08



Ув. форумчани, закомментируйте мне пожалуйста пхп-код, т.е. я вам его даю и вы напишити возле каждой строчки, что означает этот кусок кода:

вот код:
CODE

<?php
include("elements/bd.php");
if (!isset($_SERVER['PHP_AUTH_USER']))

{
       Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
       Header ("HTTP/1.0 401 Unauthorized");
       exit();
}

else {
       if (!get_magic_quotes_gpc()) {
               $_SERVER['PHP_AUTH_USER'] = mysql_escape_string($_SERVER['PHP_AUTH_USER']);
               $_SERVER['PHP_AUTH_PW'] = mysql_escape_string($_SERVER['PHP_AUTH_PW']);
       }

       $query = "SELECT pass FROM admin WHERE user='".$_SERVER['PHP_AUTH_USER']."'";
       $lst = @mysql_query($query);

       if (!$lst)
       {
           Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
       Header ("HTTP/1.0 401 Unauthorized");
       exit();
       }

       if (mysql_num_rows($lst) == 0)
       {
          Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
          Header ("HTTP/1.0 401 Unauthorized");
          exit();
       }

       $pass =  @mysql_fetch_array($lst);
       if ($_SERVER['PHP_AUTH_PW']!= $pass['pass'])
       {
           Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
          Header ("HTTP/1.0 401 Unauthorized");
          exit();
       }


}




?>

и, пожалуйста, не спрашивайте, зачем мне это нужно. Буду очень благодарен!


--------------------
user posted image
PMEmail PosterICQ
Top
Shock
Отправлено: Jun 8 2009, 10:42 AM
Quote Post


  Команда ЭйсВэб
*

Группа: Super moderator
Сообщений: 612
Пользователь №: 1704
Регистрация:
16-July 08



CODE
<?php
include("elements/bd.php"); // Наверное подсодинение к БД
if (!isset($_SERVER['PHP_AUTH_USER'])) // Если пользователь не вошел, тогда нужно войти

{
      Header ("WWW-Authenticate: Basic realm=\"Admin Page\""); // Посилаем запрос на авторизацию через код 401
      Header ("HTTP/1.0 401 Unauthorized");
      exit();
}

else {
      if (!get_magic_quotes_gpc()) { // Если волшебные кавычки не включены, тогда фильтруем входящие данные
              $_SERVER['PHP_AUTH_USER'] = mysql_escape_string($_SERVER['PHP_AUTH_USER']);
              $_SERVER['PHP_AUTH_PW'] = mysql_escape_string($_SERVER['PHP_AUTH_PW']);
      }

      $query = "SELECT pass FROM admin WHERE user='".$_SERVER['PHP_AUTH_USER']."'"; // Запрос на проверку идентичности паролей
      $lst = @mysql_query($query); // Выполняем запрос

      if (!$lst) // Если запрос ничего не вернул
      {
          Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
      Header ("HTTP/1.0 401 Unauthorized");
      exit();
      }

      if (mysql_num_rows($lst) == 0) // Если запрос ничего не вернул. Код ужасный)
      {
         Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
         Header ("HTTP/1.0 401 Unauthorized");
         exit();
      }

      $pass =  @mysql_fetch_array($lst); // Если запрос все же что-то вернул - "превращаем" результат в массив
      if ($_SERVER['PHP_AUTH_PW']!= $pass['pass']) // Проверяем на идентичность. Если неверно - Следовало бы перезагрузить страницу, но в этом скрипте опять посылается запрос на авторизацию через код 401
      {
          Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
         Header ("HTTP/1.0 401 Unauthorized");
         exit();
      }


}




?>


--------------------
PMEmail PosterICQ
Top
alex_shtil
Отправлено: Jun 9 2009, 09:32 AM
Quote Post


  Полковник
*

Группа: Members
Сообщений: 132
Пользователь №: 1629
Регистрация:
7-June 08



спасибо


--------------------
user posted image
PMEmail PosterICQ
Top
ruitrjiu
Отправлено: Dec 7 2013, 11:14 AM
Quote Post


  Unregistered









Arc Interiors Type Number of Beverly<br><br>Hills seemed to be earned to aid build a new image to the space, Chloe Handbags Outlet based around a gleaming latest bright fiberglass duplication on the mid-century Celine bags cutting-edge timeless finally, the Eero Saarinen Tulip 22 dinner table, through several ergonomic chairs having excellent teal cushions $825, Finally, the smooth established in good shape considerably more adequately in the breathing space, Womens Burberry along with the basamento pattern thighs removed typically the in a mess try looking in the bedroom. With all the meal table in addition to chair since the kick off point, Mid-foot ( arch ) Interiors' Christopher Grub together with Hermosa Turner thought of a fresh vintage hunt for the area, completely, most during the slight spending budget wants on the purchaser.<br>
The nook tested excessive ceiling
Arch Interiors Style Number of Beverly
Foot posture Interiors Pattern Couple of Beverly oooooo
Top
ruitrjiu
Отправлено: Dec 12 2013, 01:37 PM
Quote Post


  Unregistered









It could most likely the fact that the girl stop still did not amaze very many men and women<br><br>This year, the former Hannah Montana star Cheap Air Jordan has been videotaped using tobacco Prada Bags at a bong. The girl said the exact chemical on the bong is the appropriate substance salvia once the training video caused a scandal. Still Womens Prada Handbags some other movie came about during the next year that included the actual caricaturer proudly discussing she is for a stoner.<br>
Wherein some people showed little ones from numerous
Do you consider of which Miley's EMAs
Think that Miley's EMAs xxxxxx
Top

Topic Options Reply to this topicStart new topicStart Poll

 



[ Script Execution time: 0.0210 ]   [ 10 queries used ]   [ GZIP выключен ]