Part of the EllisLab Network
   
 
Blank Page
Posted: 11 July 2008 01:28 AM   [ Ignore ]  
Research Assistant
RankRankRank
Total Posts:  499
Joined  05-30-2008

I’m trying to email a user when someone submits a comment to an image. It was working fine until I started doing the email part. Any ideas why it’s giving me a blank page?

If there is some lines of code commented out, it’s because I was trying to debug what it could be.

Btw: It doesn’t even echo Test on the page

function comment()
  
{
    
if ($this->loginlib->checkSession())
    
{
    $this
->comments->photo_id $this->input->post('photo_id'true);
    
$theUsername $this->comments->getOwner();
    
$this->users->username $theUsername->username;
    
$getUser $this->users->get();


     if (
$this->comments->permission())
     
{
    $this
->comments->poster $this->session->userdata('logged_in');
    
$this->comments->comment $this->input->post('comment'True);
    
$this->comments->posted date("Y-m-d");
    
//$this->comments->insert();
    
if ($getUser->allow_comments == "true")
    
{
    $this
->sendemaillib->to $getUser->email;
    
$this->sendemaillib->from 'nobody@phonebroadcasting.com';
    
$this->sendemaillib->fromName $getUser->fName ' ' $getUser->lName;
    
$this->sendemaillib->subject 'You got a new comment on an image!';
    
$this->sendemaillib->message 'This is a test message!';
    
//$this->sendemaillib->sendIt();
    
}
    redirect
('/picture/id/'.$this->comments->photo_id);
     
}
     }
    
echo "test";
  
function getOwner()
  
{
    
if ($this->photo_id)
    
{
      $poster 
$this->db->get_where('pb_photos', array('id' => $this->photo_id));
      
$post_id $poster->row();
      
$check $this->db->get_where('project_users', array('username' => $post_id->poster));
      
      return 
$check->row();
    
else {
     
return false;
    
}
  } 
<?php

class Sendemaillib
{

  
var $to;
  var 
$from;
  var 
$fromName// First and Last name of You
  
var $subject;
  var 
$message;

  function 
Sendemaillib()
  
{
    $this
->CI =& get_instance();
    
$this->CI->load->library('email');
  
}

  
function sendIt()
  
{
    
if (isset($this->to) && isset($this->from) && isset($this->subject) && isset($this->message))
    
{
      $this
->email->to($this->to);
      
$this->email->from($this->from$this->fromName);
      
$this->email->subject($this->subject);
      
$this->email->message($this->message);
      
$this->email->send();
      
$errors = array('error' => 'Email sent successfully to' $this->to '!');
      return 
$errors;
    
else {
      $errors 
= array('error' => 'Not everything is set!');
      return 
$errors;
    
}

    }

Profile