CodeIgniter Forums
Trackback not work. Why? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Trackback not work. Why? (/showthread.php?tid=47191)



Trackback not work. Why? - El Forum - 11-29-2011

[eluser]Unknown[/eluser]
I have two controllers:
test.php
Code:
public function trackback()
      {
        $this->load->library('trackback');
$tb_data = array(
                 'ping_url'  => 'http://www.citest.com/addtrackback/receive/777',
                 'url'       => 'http://www.citest.com/test/trackback/',
                 'title'     => 'Заголовок',
                 'excerpt'   => 'Текст.',
                 'blog_name' => 'Название блога',
                 'charset'   => 'utf-8'
                 );

if ( ! $this->trackback->send($tb_data))
{
      echo $this->trackback->display_errors();
}
else
{
      echo 'Trackback успешно отправлен!';
}
      }

function trackback() send trackback

addtrackback.php
Code:
public function receive()
     {
    $this->load->library('trackback');


if ($this->uri->segment(3) == FALSE)
{
     $this->trackback->send_error("Не указан ID записи ");
}

if ( ! $this->trackback->receive())
{
     $this->trackback->send_error("Trackback содержит некорректные данные!");
}

$data = array(
                 'tb_id'      => '',
                 'entry_id'   => $this->uri->segment(3),
                 'url'        => $this->trackback->data('url'),
                 'title'      => $this->trackback->data('title'),
                 'excerpt'    => $this->trackback->data('excerpt'),
                 'blog_name'  => $this->trackback->data('blog_name'),
                 'tb_date'    => time(),
                 'ip_address' => $this->input->ip_address()
                 );

$sql = $this->db->insert_string('trackbacks', $data);
$this->db->query($sql);

$this->trackback->send_success();
}

function receive() get trackback and write in database


I have in DataBase table: 'trackbacks'

But it view error: An unknown error was encountered

Where is error?