drupal_set_header

  1. drupal
    1. drupal6
    2. drupal7 bootstrap.inc
Versionen
drupal6 drupal_set_header($header = NULL)
drupal7 drupal_set_header($name = NULL, $value = NULL, $append = FALSE)

Set an HTTP response header for the current page.

Note: When sending a Content-Type header, always include a 'charset' type, too. This is necessary to avoid security bugs (e.g. UTF-7 XSS).

▾ 14 functions call drupal_set_header()

blogapi_rsd in modules/blogapi/blogapi.module
drupal_access_denied in includes/common.inc
Generates a 403 error if the request is not allowed.
drupal_get_headers in includes/common.inc
Get the HTTP response headers for the current page.
drupal_json in includes/common.inc
Return data in JSON format.
drupal_not_found in includes/common.inc
Generates a 404 error if the request can not be handled.
drupal_site_offline in includes/common.inc
Generates a site off-line message.
file_transfer in includes/file.inc
Transfer file using http to client. Pipes a file through Drupal to the client.
node_feed in modules/node/node.module
A generic function for generating RSS feeds from a set of nodes.
theme_aggregator_page_opml in modules/aggregator/aggregator.pages.inc
Theme the OPML feed output.
theme_aggregator_page_rss in modules/aggregator/aggregator.pages.inc
Theme the RSS output.
theme_install_page in includes/theme.maintenance.inc
Generate a themed installation page.
theme_update_page in includes/theme.maintenance.inc
Generate a themed update page.
_db_error_page in includes/database.inc
Helper function to show fatal database errors.
_drupal_bootstrap_full in includes/common.inc

Code

includes/common.inc, line 141

<?php
function drupal_set_header($header = NULL) {
  // We use an array to guarantee there are no leading or trailing delimiters.
  // Otherwise, header('') could get called when serving the page later, which
  // ends HTTP headers prematurely on some PHP versions.
  static $stored_headers = array();

  if (strlen($header)) {
    header($header);
    $stored_headers[] = $header;
  }
  return implode("\n", $stored_headers);
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen