-1

Can any one help about this error?

Thanks.

        echo $baslik.' yazı eklendi. ID = '.$postid;

you can see previous lines below thanks.

     $postid=wp_insert_post( $my_post );
      add_post_meta($postid, 'target', $md5);
      add_post_meta($postid, 'psp_meta', 'a:19:{s:5:"title";s:13:"'.stripslashes($baslik).'";s:11:"description";s:15:"'. $HaberOzet.'";s:8:"keywords";s:27:"'. $etiket.'";s:13:"focus_keyword";s:0:"";s:17:"facebook_isactive";s:2:"no";s:14:"facebook_titlu";s:0:"";s:13:"facebook_desc";s:0:"";s:14:"facebook_image";s:0:"";s:23:"facebook_opengraph_type";s:7:"article";s:12:"robots_index";s:7:"default";s:13:"robots_follow";s:7:"default";s:8:"priority";s:1:"-";s:9:"canonical";s:0:"";s:21:"psp_twc_post_cardtype";s:7:"summary";s:20:"psp_twc_app_isactive";s:2:"no";s:22:"psp_twc_post_thumbsize";s:7:"120x120";s:13:"psp_twc_title";s:0:"";s:19:"psp_twc_description";s:0:"";s:13:"psp_twc_image";s:0:"";}')

      echo $baslik.' yazı eklendi. ID = '.$postid;
}else{
  echo 'DAHA ÖNCE EKLENMİŠHABER';
}
Yasin Çimen
  • 1
  • 1
  • 4
  • 1
    What is __before__ this line? – u_mulder May 31 '16 at 19:34
  • As u_mulder said, make sure to check the previous line - sometimes this error occurs because you are missing a **semicolon** so the interpreter doesn't know that the previous line ended – Vineet Kosaraju May 31 '16 at 19:36
  • @Yasin: see this question, you have the same issue the asker did. You need to install the mbstring extension, enable it during compilation, or ask your host to do the same: http://stackoverflow.com/questions/17204437/fatal-error-call-to-undefined-function-mb-detect-encoding – Josh Rumbut May 31 '16 at 19:56

1 Answers1

0

You had no semicolon at the end of the line before it, the massive call to add_post_meta(...)

The correct code would be:

     $postid=wp_insert_post( $my_post );
      add_post_meta($postid, 'target', $md5);
      add_post_meta($postid, 'psp_meta', 'a:19:{s:5:"title";s:13:"'.stripslashes($baslik).'";s:11:"description";s:15:"'. $HaberOzet.'";s:8:"keywords";s:27:"'. $etiket.'";s:13:"focus_keyword";s:0:"";s:17:"facebook_isactive";s:2:"no";s:14:"facebook_titlu";s:0:"";s:13:"facebook_desc";s:0:"";s:14:"facebook_image";s:0:"";s:23:"facebook_opengraph_type";s:7:"article";s:12:"robots_index";s:7:"default";s:13:"robots_follow";s:7:"default";s:8:"priority";s:1:"-";s:9:"canonical";s:0:"";s:21:"psp_twc_post_cardtype";s:7:"summary";s:20:"psp_twc_app_isactive";s:2:"no";s:22:"psp_twc_post_thumbsize";s:7:"120x120";s:13:"psp_twc_title";s:0:"";s:19:"psp_twc_description";s:0:"";s:13:"psp_twc_image";s:0:"";}');

      echo $baslik.' yazı eklendi. ID = '.$postid;
}else{
  echo 'DAHA ÖNCE EKLENMİŠHABER';
}

PS: unless you know that stripslashes($baslik) will always be 13 characters long, and that $HaberOzet will always be 15 characters long, your code may be prone to bugs.

Josh Rumbut
  • 2,640
  • 2
  • 32
  • 43