Jump to content

Able to send limited data using curlopt_postfield??


siddscool19

Recommended Posts

<?php
$content=$_REQUEST["post"];
echo $content;
$url = "http://(forumhostname)/login.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 4);
curl_setopt($ch, CURLOPT_POSTFIELDS,"username=(username)&password=(pass)&redirect=&login=Log+in");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch,CURLOPT_COOKIEJAR,"cookie.txt");
$result= curl_exec ($ch);
curl_close ($ch);
$ch2 = curl_init();
    curl_setopt($ch2,CURLOPT_URL,"http://(forumhostname)/posting.php");
    curl_setopt($ch2,CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($ch2,CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch2,CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch2,CURLOPT_CONNECTTIMEOUT,"120");
curl_setopt($ch2,CURLOPT_COOKIEFILE,"cookie.txt");
curl_setopt($ch2, CURLOPT_POST,5);
curl_setopt($ch2, CURLOPT_POSTFIELDS,"subject=hi&message=".$content."&f=1&mode=newtopic&preview=Preview");
$souvik123 = curl_exec($ch2);
$error=curl_error($ch2);
    curl_close($ch2);
echo $error;
echo $souvik123;
?>

 

This is my above code. When I send about a limited amount of data in $content it works but if i send a large amount of data in $content it doesn't works.Why?

Please can someone help?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.