hello,
i m developing a reviw based website in which i have to make articles on automation that makes articles from the data in my sql table but the problem is i m not able to deal with the multipart form cURL script
can someone please help me solve this problem ?
if i m unable to complete this script then my website wont come into existence .lol
Here is my script so far.
[PHP]<?php
//token contain hidden form fields values
function curl_post2($site,$token){
$boundary = '-----------------------------7665267813202';
$header = array (
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language: en-us,en;q=0.5',
'Accept-Encoding: gzip, deflate',
'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Keep-Alive: 115',
'Connection: keep-alive',
'Referer: http://mysite.com?q=node%2Fadd%2Farticle&',
'Content-Type: multipart/form-data'
);
//print_r($header);
$data['title'] = "hello there";
$data['field_tags[und]'] = "hiiii";
$data['body[und][0][summary]'] = "";
$data['body[und][0][value]'] = "hello everybody";
$data['body[und][0][format]'] = "filtered_html";
$data['files[field_image_und_0]'] = "@".realpath($image);
$data['field_image[und][0][fid]'] = "0";