Forums

Please help my plugin ploblem when use curl. (2 posts)

  1. kokarat
    Member
    Posted 9 months ago #

    <?
    function post_products() {
    	global $wpdb;
    	$tbl_config = "config";
    	$post_url = $wpdb->get_row ( "SELECT * FROM $tbl_config WHERE id = '1'" );
    	$numofpost = $post_url->ms_bulk;
    	$cron_url_db = $post_url->ms_tmp_url;
    	function_post($cron_url_db,$numofpost);
    }
    
    function function_post($site_cron,$numofpost) {
    		for($i = 1; $i <= $numofpost; $i ++) {
    		$ch = curl_init ();
    		curl_setopt ( $ch, CURLOPT_POST, 0 );
    		curl_setopt ( $ch, CURLOPT_URL, $site_cron);
    		curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
    		$result = curl_exec ( $ch );
    		curl_close ( $ch );
    	}
    }
    ?>

    I need to exccute variable $cron_url_db
    the result of

    $cron_url_db = $post_url->ms_tmp_url;
    is : http://www.xxxxx.com/xxxx
    when i call function
    function_post()
    which is select by
    $cron_url_db = $post_url->ms_tmp_url;
    curl not execute.

    But I try to static fix variable $cron_url_db to $cron_url_db = 'http://www.xxxxx.com/xxxx';

    then call same function curl is execute work well.

    what's i wrong ? please help and sorry for my grammar.

  2. kokarat
    Member
    Posted 9 months ago #

    unsolved problem.

Reply

You must log in to post.

About this Topic

Tags