Hi,
Can anyone help me to upload pics to fastpic.ru with php?
Thanks
I'm using this code but it return the main page:
Can anyone help me to upload pics to fastpic.ru with php?
Thanks
I'm using this code but it return the main page:
PHP:
function curl($link, $postfields = '', $cookie = '', $refer = '')
{
set_time_limit(0);ini_set('max_execution_time', 0);
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
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');
if($refer)
{
curl_setopt($ch, CURLOPT_REFERER, $refer);
}
if($postfields)
{
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
}
if($cookie)
{
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
}
$page = curl_exec($ch);
//echo $page;
return($page);
curl_close($ch);
}
$link = "http://fastpic*****"; $postfields2 = array( 'file[]' => '@'.$imgpathPOST); $postResult2 = curl ($link,$postfields2 ); print_r($postResult2);
Last edited: