Yii Framework Forum: Cannot modify header information - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cannot modify header information Rate Topic: -----

#1 User is offline   evo4g63 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 31-July 12

Posted 06 August 2012 - 01:28 AM

Good Day!

I'm trying to saving the contents of my form, I'm using CJuiDialog and CActiveForm at the same time. There's is no problem in the form, the problem occurs when hitting the save button.

Here is the description of error returned by PHP:

Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\ADS\protected\controllers\CreditorDebtorController.php:73)

here is the stack trace:

     public function redirect($url,$terminate=true,$statusCode=302)
654     {
655         if(strpos($url,'/')===0)
656             $url=$this->getHostInfo().$url;
[color="#FF0000"]657         header('Location: '.$url, true, $statusCode);[/color]
658         if($terminate)
659             Yii::app()->end();
660     }



Stack Trace #2
C:\xampp\htdocs\ADS\protected\controllers\CreditorDebtorController.php(102): CController->redirect(array("view", "creditorId" => null))

097                                             //$this->redirect(array('view','id'=>$model->BOOK_UID)); // Redirect to another page.
098                                 exit;
099                             }
100                             else
101                             //print_r($_POST['CreditorDebtor']);    
[color="#FF0000"]102                             $this->redirect(array('view','creditorId'=>$model->creditorId));[/color]
103                         }
104                    
105                         //$this->renderPartial('_form',array('model'=>$model));
106                     }


Thank you very much guys.....

:D :D :D :D
0

#2 User is offline   Tropi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 30-November 11

Posted 06 August 2012 - 03:08 AM

It would be important to have CreditorDebtorController.php:73 as stated in the error message. Most likely you have an echo, so PHP needs to send an earlier and thus cannot send another one later, or a command there doesn't work, so PHP also sends a(n error) message.
0

#3 User is offline   evo4g63 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 31-July 12

Posted 06 August 2012 - 03:40 AM

After saving the record i'm trying to redirect the it to another page. Unfortunately I don't have an idea why the creditorId = null. I already check my stored procedure oracle and its working.
0

#4 User is offline   drylko 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 13-September 09
  • Location:Poland

Posted 06 August 2012 - 04:01 PM

Hi,

View Postevo4g63, on 06 August 2012 - 03:40 AM, said:

CreditorDebtorController.php:73


what do you have in 73rd line of this controller?
0

#5 User is offline   nirmalroka 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 44
  • Joined: 10-July 12
  • Location:Kathmandu Nepal

Posted 16 November 2012 - 12:37 AM

I had also got this error.

Cannot modify header information - headers already sent by (output started at /home1/fxgivesc/public_html/weinside/protected/controllers/SiteController.php:1)

I checked out all echo or print value in that file. I checked the spaces before and after the opening and closing of php tag i got nothing there.

I tried hard , i googled down the internet and reached there. This discussion helped

http://www.yiiframew...irect-problems/

What my error was duing upload may be some hex encoding problem.

I copied the content of file in text editor and saved it and i uploaded the same file to server it works like a magic.
0

#6 User is offline   Backslider 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 357
  • Joined: 23-July 09

Posted 29 December 2012 - 06:20 PM

nirmalroka - the person you are working for will never pay you.
We were all once expert at....... nothing.

yii-language-behavior

My Blog
0

#7 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 29 December 2012 - 06:41 PM

View PostBackslider, on 29 December 2012 - 06:20 PM, said:

nirmalroka - the person you are working for will never pay you.


Now I'm intrigued. Posted Image
"Less noise - more signal"
0

#8 User is offline   Backslider 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 357
  • Joined: 23-July 09

Posted 29 December 2012 - 08:34 PM

View Postjacmoe, on 29 December 2012 - 06:41 PM, said:

Now I'm intrigued. Posted Image


I recognised the server from the error message that was posted. The person who owns this website hires Yii developers, then does not pay them and locks them out of the server.... then brings along the next bunch of devs to dupe.

The guy is a crook: Yosi Peri - Yosi Friedman
We were all once expert at....... nothing.

yii-language-behavior

My Blog
1

#9 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 30 December 2012 - 04:50 AM

Ouch, that sucks.

Thanks for the heads up. I gather he's black listed at the various freelance sites?
If not, he should be.
"Less noise - more signal"
0

#10 User is offline   Backslider 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 357
  • Joined: 23-July 09

Posted 30 December 2012 - 01:24 PM

View Postjacmoe, on 30 December 2012 - 04:50 AM, said:

Ouch, that sucks.

Thanks for the heads up. I gather he's black listed at the various freelance sites?
If not, he should be.


I'm not sure, however because he has had many devs of various talent work on the website, there are many security flaws. I can bring down the whole website at any time I please, or write to the file system or database, even without access to his cPanel or FTP :P
We were all once expert at....... nothing.

yii-language-behavior

My Blog
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users