You are here: What is the purpose of the 401 Header in this PHP Manual Chapter 34 'HTTP/1.0 401 Unauthorized' seems unncessary in this « PHP Programming Language « IT news, forums, messages
What is the purpose of the 401 Header in this PHP Manual Chapter 34 'HTTP/1.0 401 Unauthorized' seems unncessary in this

Posted by Reporter on 07/01/07 20:18

<?php

if (!isset($_SERVER['PHP_AUTH_USER'])) {
//header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button';
exit;
} else {
echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</
p>";
}
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация