comparison common-functions.inc @ 90:aafc23919e79

Validating errorPage.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Wed, 17 Oct 2012 21:23:02 +0200
parents 7a9c45b53866
children 8aadd7a23b68
comparison
equal deleted inserted replaced
89:fd39d7d5e9be 90:aafc23919e79
113 * @param $errorCode the status code to be served 113 * @param $errorCode the status code to be served
114 */ 114 */
115 function errorPage($errorText, $errorCode = 403) 115 function errorPage($errorText, $errorCode = 403)
116 { 116 {
117 header(StatusCodes::httpHeaderFor($errorCode)); 117 header(StatusCodes::httpHeaderFor($errorCode));
118 print '<?xml version="1.0" encoding="UTF-8"?>';
119 print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
120 <html xmlns="http://www.w3.org/1999/xhtml"><head>';
121
122 print '<title>' . StatusCodes::httpHeaderFor($errorCode) . '</title>';
123 print '</head><body>';
118 print "<div id=\"page\"><h1>${errorText}</h1></div>"; 124 print "<div id=\"page\"><h1>${errorText}</h1></div>";
125 print '</body></html>';
126
119 exit; 127 exit;
120 } 128 }
121 129
122 /** 130 /**
123 * Generates an URL for the specified parameters 131 * Generates an URL for the specified parameters