summaryrefslogtreecommitdiff
path: root/lib/http.php
blob: 9b633376711d21524d0f14fde843170381fbe125 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?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);
};