summaryrefslogtreecommitdiff
path: root/lib/http.php
blob: 5fe87dcfa3de6a0a50638e86532a7f88f5558c9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php


# do not include twice
if (function_exists("throw_http_error"))
  return;

function throw_http_error($error_number, $error_message, $extra_message = "") {
  header("Status: " . $error_number . " " . $error_message);
  print "Error " . $error_number . ": " . $error_message . "\n";
  if ($extra_message != "")
    print "<br>\n" . $extra_message;
  die();
};

function die_500($message) {
  throw_http_error(500, "Internal Server Error", $message);
};