title: My web page redirects to a blank screen on submitting the form
body: <p>I am trying to display a flash message saying 'Mail sent' on sending an email from a form in cakephp. The email is send successfully to the recipient but then it goes to a blank screen and doesn't display the flash message which indicates that the message has been sent.I have checked for spaces before and after php tags in the controller and that doesnt seem to be the problem.IT works fine on my localhost and displays the message but not on the server.I will put my controller code</p>
  
  <pre><code>public function contact() {
  
      $email = new CakeEmail();
      if ($this-&gt;request-&gt;is('post')) {
          $this-&gt;Contact-&gt;set($this-&gt;request-&gt;data);
          if ($this-&gt;Contact-&gt;save($this-&gt;request-&gt;data)) {
              //$this-&gt;Project-&gt;set($this-&gt;data)
              $name = $this-&gt;request-&gt;data['Contact']['name'];
              $mail = $this-&gt;request-&gt;data['Contact']['email'];
              $email-&gt;from(array($mail =&gt; $name));
              $email-&gt;to('sales@blacknova.com.au');
              if (isset($this-&gt;request-&gt;data['Contact']['contacttime'])) {
                  $ctime = implode(',', $this-&gt;request-&gt;data['Contact']['contacttime']);
              }
              $message = "Phone No : ".$this-&gt;request-&gt;data['Contact']['phone']."\n\nBest Contact time :".$ctime." \n\nMessage : ".$this-&gt;request-&gt;data['Contact']['description'];
              $email-&gt;subject('BlackNova Website Contact Form Message');
              //$email-&gt;send($message);
              //$success =1;
              //$email-&gt;send($this-&gt;request-&gt;data['Contact']['phone']);
              //pr($message);
              if ($email-&gt;send($message)) {
                  $this-&gt;Session-&gt;setFlash('Mail sent successfully');
                  $this-&gt;redirect(array('controller' =&gt; 'BlockContents', 'action' =&gt; 'contact'));
                  //pr($success);
              }
          }
      }
  }
  </code></pre>
  
  <p>There is a contact.ctp </p>
  
  <pre><code>    &lt;div id="formcontainer_left"&gt;
      &lt;?php echo $this-&gt;Form-&gt;create('Contact'); ?&gt; 
      &lt;div class="inputbox1"&gt;&lt;?php echo $this-&gt;Form-&gt;input('name');?&gt;&lt;/div&gt;&lt;br&gt;
      &lt;div class="inputbox2"&gt;&lt;?php echo $this-&gt;Form-&gt;input('email'); ?&gt;&lt;/div&gt;&lt;br&gt;
      &lt;div class="inputbox3"&gt;&lt;?php echo $this-&gt;Form-&gt;input('phone');?&gt;&lt;/div&gt;&lt;br&gt;
      &lt;/div&gt;
      &lt;div id="formcontainer_right"&gt;  
      &lt;div id="me"&gt;&lt;?php echo $this-&gt;Form-&gt;input('description');?&gt;
      &lt;/div&gt;
      &lt;?php echo $this-&gt;Form-&gt;submit('SUBMIT');?&gt;
  
      &lt;/div&gt;
  
        &lt;div  id="formcontainer_xright"&gt;
  
      &lt;div class="formcontainer_last"&gt; BEST TIME TO CONTACT* &lt;/div&gt;
      &lt;div id="chkbox"&gt;
       &lt;?php echo $this-&gt;Form-&gt;input('contacttime',array('label'=&gt;false,'type'=&gt;'select','class'=&gt;'checkdiv','multiple'=&gt;'checkbox','options'=&gt;array('Before work' =&gt;'Before work','During work'=&gt;'During work','After work'=&gt;'After work'),'escape'=&gt;false)) ;?&gt; 
      &lt;/div&gt;
        &lt;/div&gt;
              &lt;?php echo $this-&gt;Form-&gt;end(); ?&gt;
          &lt;div class="contactformbottom"&gt;
      &lt;/div&gt;
  
  &lt;/div&gt; 
  
  &lt;div id="formcontainer2"&gt;
     &lt;p&gt; &lt;?php echo $this-&gt;Session-&gt;flash();?&gt;&lt;/p&gt;
  </code></pre>
  
  <p>Could somebody please help me find out why it happens only on the srver and not on the local host?</p>