diff options
author | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-13 08:34:05 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-13 08:34:05 +0300 |
commit | b9d2b8467dd4046512b86e0f63feefb6b06c2789 (patch) | |
tree | 02b4e9affb56ba09e39edde854fd24be242ea0e7 | |
parent | 2e445c73f777d4587aa3eda9e457d258a2482de8 (diff) | |
download | main-b9d2b8467dd4046512b86e0f63feefb6b06c2789.tar.gz main-b9d2b8467dd4046512b86e0f63feefb6b06c2789.tar.bz2 main-b9d2b8467dd4046512b86e0f63feefb6b06c2789.zip |
App/json header fixes
-rw-r--r-- | App.php | 12 | ||||
-rw-r--r-- | Db.php | 2 |
2 files changed, 9 insertions, 5 deletions
@@ -90,15 +90,19 @@ class App static function ok($msg) { $ok = array('result' => 'ok', 'msg' => $msg); - header("Content-type application/json"); - return json_encode($ok); + $json = json_encode($ok); + header("Content-Type: application/json"); + header("Content-Length: " . strlen($json)); + print $json; } static function error($msg) { $err = array('result' => 'error', 'msg' => $msg); - header("Content-type application/json"); - return json_encode($err); + $json = json_encode($err); + header("Content-Type: application/json"); + header("Content-Length: " . strlen($json)); + print $json; } /** @@ -1,7 +1,7 @@ <?php /** - * boeuf/Db.php + * main/Db.php * @author Filipp Lepalaan <filipp@mekanisti.fi> * http://www.php.net/manual/en/language.oop5.patterns.php */ |