Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php //exit;
- echo $url = 'http://www.galaxyreportage.com/cron/prexposting.php';
- $ch = curl_init();
- if($ch === false)
- {
- die('Failed to create curl object');
- }
- curl_setopt ($ch, CURLOPT_URL, $url);
- curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
- curl_setopt ($ch, CURLOPT_POST, true);
- $data = array(
- 'title'=>'Test',
- 'slug'=> 'test',
- 'content'=> 'Content',
- 'cat_id'=>'1',
- 'publish_date'=>'2019-01-16 00:00:00',
- 'link'=>'',
- 'content_index'=>1
- );
- // The submitted form data, encoded as query-string-style name-value pairs
- //$post_data = 'name=Harry&age=25';
- curl_setopt ($ch, CURLOPT_POSTFIELDS, $data);
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
- curl_setopt($ch, CURLOPT_TIMEOUT, 30);
- $httpCode = curl_getinfo($ch , CURLINFO_HTTP_CODE); // this results 0 every time
- $output = curl_exec($ch);
- if ($output === false) $output = curl_error($ch);
- echo stripslashes($output);
- curl_close ($ch);
- //echo $output;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement