PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
help me!
i think parsing a webpage then insert contents into wordpress wp_post table.
but, when i require('wp-load.php'); it throw Fatal error: Call to a member function find() on a non-object in C:\wamp\www\simple_html_dom.php on line 879.
when i disable //require('wp-load.php'); it throw Fatal error: Call to undefined function wp_insert_post() in C:\wamp\www\testinclud.php on line 22
$row['FileID'] = '108804966' //get $row['FileID'] from database,it with $parseURL Form a complete Web site
$parseURL = 'http://www.tradebit.com/visit.php/71080/product/-/';
//get $row['FileID'] from database,it with $parseURL Form a complete Web site.
while ($row = mysql_fetch_array($results, MYSQL_ASSOC)) {
global $post;
parse_html($parseURL_pre . $row['FileID']);
[b]require_once('wp-load.php');// :?: :?: :?: i require_once('wp-load.php'); at wp_insert_post($post) can be run once.[/b]
wp_insert_post($post); //insert $post into wp_post table
}
why??? after i require_once('wp-load.php') the 'simple_html_dom.php' can not be use.