Why?include wp-load with simple_html_dom have conflict.
Why is this 'include('wp-load.php')' with 'include('simple_html_dom.php')' will have a conflict???
include 'wp-load.php' for run function wp_insert_post($post) ,
but once include 'wp-load.php' ,the parse function can not to run that in 'simple_html_dom.php'.
can any one to help me? thanks a lot.
//include('wp-load.php'); //include 'wp-load.php' for run function wp_insert_post($post)
$post = array();
$post['post_status'] = 'publish';
$post['post_author'] = 1;
$post['comment_status'] = 'closed';
$post['post_title'] = '';
$post['post_content'] = '';
$post['post_date'] = date('Y-m-d H:i:s',strtotime("now"));
$parseURL = 'http://www.tradebit.com/visit.php/71080/product/-/87837706';
$html = new simple_html_dom();
$title = $html->find("title", 0);
$title = explode(" - ", $title->plaintext);
$post['post_title'] = $title;
$post['post_content'] = $html->find('div[class=orangeContent]',1);
echo '$post post_content ' . $post['post_content'] . '<br>';
echo 'title' . '<br>';
echo $post['post_title'] . '<br>';
First of all please post php in php tags so its more readable
without the .'s
And please post the error you are getting along with those 2 scripts that are conflicting.
wp-load with simple_html_dom have a conflict
hi, thanks your reply.
when i disable include wp-load , it throw below error.
Fatal error: Call to undefined function wp_insert_post() in C:\wamp\www\testinclude.php on line 26
for function wp_insert_post() need include wp-load.
when i include wp-load the simple-html-dom cannot work.
it throw below error.
Fatal error: Call to a member function find() on a non-object in C:\wamp\www\simple_html_dom.php on line 879
wp-load with simple_html_dom have a conflict.
can anyone give a hand? thank a lot.
Here is a website talking about it
this program think parse website then auto post to wordpress blog.
so it need include wpload.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread