Permalink
Browse files

Header views update.

  • Loading branch information...
1 parent d2704db commit 921e84c9a22e05be2e6597ce48f22a736857b930 @atomicframeworks committed Jan 7, 2012
View
4 application/controllers/controller.class.php
@@ -57,6 +57,8 @@ public function commitTransaction(){
}
public function setHeader($headersArray = array()){
+ // Start output buffering to show headers first always
+ ob_start();
if (!empty($headersArray)){
if(is_array($headersArray)){
foreach ($headersArray as $header){
@@ -101,8 +103,8 @@ public function displayView(){
$controller->setHeader('404');
// Display the 404
$controller->displayHeaders();
-
}
+ ob_end_flush();
}
}
?>
View
13 application/views/headers/404.php
@@ -5,9 +5,18 @@
header($header);
//print_r(get_defined_vars());
?>
+<html>
+ <body>
+ <style>
+ </style>
+
+ <h2>
+ ERROR 404: Not Found
+ </h2>
+ The requested url <?php echo $_SERVER['REQUEST_URI']; ?> was not found on this server.
+ </body>
+</html>
-ERROR: 404 <br/>
-<?php echo $_SERVER['REQUEST_URI']; ?> -- Not Found!
<?php die;?>
View
3 application/views/headers/503.php
@@ -1,9 +1,8 @@
<?php
$header = 'HTTP/1.1 503 Service Unavailable';
header($header);
+ die;
?>
ERROR: 503 <br/>
Service Unavailable
-
-<?php die;?>
View
6 application/views/proxies/select.php
@@ -1,9 +1,6 @@
-<!--
-<?php //header("Content-type: text/plain"); ?>
--->
-
<?php
//print_r(get_defined_vars());
+ //echo $controller->database . DS . $controller->view;
?>
<html>
<body>
@@ -23,7 +20,6 @@
}
</style>
-<?php echo $controller->database . DS . $controller->view;?>
<form method="get" action="../<?php echo $controller->database . DS ;?>show">
Query: <input type="text" size="100" maxlength="100" name="query" value='select INET_NTOA(ip) as ip, id, port, http_code, last_update from proxies where country = "China"'> <br />
<input type="submit" value="query">
View
6 config/config.php
@@ -1,9 +1,9 @@
<?php
//// Global config vars
- define('DEVELOPMENT_ENVIRONMENT',true);
+ define('DEVELOPMENT_ENVIRONMENT',false);
- define('DB_USERNAME', 'user');
- define('DB_PASSWORD', 'pass');
+ define('DB_USERNAME', 'kevin');
+ define('DB_PASSWORD', 'f00d');
define('DB_HOST', 'localhost');
View
2 library/shared.php
@@ -71,6 +71,7 @@ function tQuote($val = ''){
//// Hook used to load our view and controller from url string
function callHook (){
+ ob_start();
// Default controller that will load if none is found
$controller_str = 'proxies';
//Default view that will load if none is found
@@ -112,7 +113,6 @@ function callHook (){
//echo "<br/> Query: $queryString <br/>";
$controller->addStatement($queryString)->invoke()->fetchAll();
}
-
// Load our view
$controller->displayView();
}

0 comments on commit 921e84c

Please sign in to comment.