113 PHP warning

PHP warning

Cannot modify header information - headers already sent by (output started at /home/web/ex18.ru/protected/controllers/NewsController.php:34)

/home/web/ex18.ru/framework/web/CHttpRequest.php(803)

791     /**
792      * Redirects the browser to the specified URL.
793      * @param string $url URL to be redirected to. Note that when URL is not
794      * absolute (not starting with "/") it will be relative to current request URL.
795      * @param boolean $terminate whether to terminate the current application
796      * @param integer $statusCode the HTTP status code. Defaults to 302. See {@link http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html}
797      * for details about HTTP status code.
798      */
799     public function redirect($url,$terminate=true,$statusCode=302)
800     {
801         if(strpos($url,'/')===0 && strpos($url,'//')!==0)
802             $url=$this->getHostInfo().$url;
803         header('Location: '.$url, true, $statusCode);
804         if($terminate)
805             Yii::app()->end();
806     }
807 
808     /**
809      * Parses an HTTP Accept header, returning an array map with all parts of each entry.
810      * Each array entry consists of a map with the type, subType, baseType and params, an array map of key-value parameters,
811      * obligatorily including a `q` value (i.e. preference ranking) as a double.
812      * For example, an Accept header value of <code>'application/xhtml+xml;q=0.9;level=1'</code> would give an array entry of
813      * <pre>
814      * array(
815      *        'type' => 'application',

Stack Trace

#2
+
 /home/web/ex18.ru/protected/controllers/NewsController.php(36): CController->redirect(array("//stati"))
31 
32     public function actionCategory($id)
33     {
34         echo $id;
35         if($id == 113)
36             $this->redirect(array('//stati'));
37 
38         $model = Page::model()->find("status = 1 AND id = :id", [':id' => $id]);
39 
40         if ($model === null)
41             throw new CHttpException(404);
#12
+
 /home/web/ex18.ru/public/index.php(22): CApplication->run()
17     }
18 
19 }
20 
21 $config = dirname(__FILE__) . '/../protected/config/main.php';
22 $app = Yii::createWebApplication($config)->run();
23 
24 
25 
26 /*if(!isset($_COOKIE["maintain"])) {
27     exit();
2024-07-27 11:49:19 Apache/2.2.22 (Debian) Yii Framework/1.1.14