本文整理汇总了PHP中display_document_header函数的典型用法代码示例。如果您正苦于以下问题:PHP display_document_header函数的具体用法?PHP display_document_header怎么用?PHP display_document_header使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_document_header函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_valid_user
function check_valid_user()
{
//user logged in
if (session_is_registered('valid_user_id')) {
return;
} else {
//user tries to log in
if (!empty($_POST['user']) && !empty($_POST['password'])) {
$valid_user_id = user_ok($_POST['user'], $_POST['password']);
switch ($valid_user_id) {
case false:
// something went wrong with the DB
$title = 'B³±d bazy danych, spróbuj pó¼niej.';
break;
case -1:
//user cannot be logged in
$title = 'Nie mogê zalogowaæ u¿ytkownika ' . htmlspecialchars(stripslashes($_POST['user'])) . '!';
break;
default:
//everything OK
$_SESSION['valid_user_id'] = $valid_user_id;
$url = $_SERVER['PHP_SELF'] . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']);
header('location: ' . $url);
// reload page
exit;
}
} else {
if (!isset($_POST['user']) && !isset($_POST['password'])) {
$title = 'Zaloguj siê';
} else {
$title = '¬le wype³niony formularz! Spróbuj ponownie';
}
}
display_html_header();
display_document_header(true);
// true = with setfocus script
display_menu();
display_login_form($title);
display_document_footer();
exit;
}
}
示例2: switch
switch ($select_flag) {
case 0:
display_warning('Wybierz elementy do wyszukiwania!');
exit;
case 1:
$final_condition = $condition['in_questions'];
break;
case 2:
$final_condition = $condition['in_answers'];
break;
case 3:
$final_condition = $condition['in_questions'] . ' or ' . $condition['in_answers'];
break;
}
display_html_header();
display_document_header();
display_menu();
echo '<table width="90%">' . "\n";
echo '<tr><td align="center" class="naglowek">Pomoc - wyniki wyszukiwania<hr></td></tr>' . "\n";
echo '<tr><td class="naglowek_maly">Szukane wyra¿enie: ' . "'" . htmlspecialchars(stripslashes($_GET['search'])) . "'" . '. Oto rezultaty wyszukiwania:</td></tr>';
$results = help_search($final_condition);
/* $results[i] = array ( 'question_id' => '...',
'category_id' => '...',
'label' => '...'
);
*/
echo '<tr><td>';
if ($results === false) {
echo "B³±d bazy danych, spróbuj pó¼niej.\n";
} else {
if (empty($results)) {
示例3: display_warning
function display_warning($warning)
{
display_html_header();
display_document_header();
display_menu();
echo '<p class="naglowek">' . $warning . "</p>\n";
display_document_footer();
}