Status
Not open for further replies.
26 comments
U can get a rough idea on how to do that from below link. If u have little knowledge about PHP then u can do it ;)

http://www.wjunction.com/showpost.php?p=471035&postcount=8

yep thnx! thats wat i needed
PHP:
 $img = postHost("http://www.lulzimg.com/upload.php?submit=lulz&url=http://thetvdb.com/banners/$match[0]", "", ""); 
            //echo $img; 
            preg_match_all("/http:\/\/lulzimg.com\/[a-z0-9]+\/[a-z0-9A-Z.]+/", $img, $matches); 
            $imageUrl = $matches[0][1]; 
            return $imageUrl;
 
Sure here you go-

<form action="" method="post">
<p>
<br /><input width="80" name="imglinks"><br />
</p>
<p>
<input type="submit" value="Go ON!" />
</p>
</form>
<?php
if (!empty($_POST['imglinks']))
{
$ch = curl_init();
$imglinks=$_POST['imglinks'];
curl_setopt($ch, CURLOPT_URL,"http://www.lulzimg.com/upload.php?submit=lulz&url=$imglinks");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
$data = curl_exec($ch);
curl_close($ch);

preg_match_all("/http:\/\/lulzimg.com\/[a-z0-9]+\/[a-z0-9A-Z.]+/", $data, $matches);


$break[]=$matches[0];
echo "LULZ Share Link -";
echo $break[0][0];
echo "</br>";
echo "Direct Layout Links -";
echo $break[0][1];
echo "</br>";


echo "LULZ!! - Automan@WJunction";
}
?>

A thank would be appreciated. :D
 
Thanks automan! Btw I use GET request instead of POST and integrated it to my filemanager but haven't got a clue as to how to echo the direct link lolz. Im a newb at php :|
 
All you guys coding these 'curl upload' snippets, try not to mash things together AND set CURLOPT_UPLOAD to 1 so curl knows you're preparing for an upload, its likely more efficient that way.
 
@JmZ CURLOPT_UPLOAD (previously CURLOPT_PUT) is for uploading files using HTTP PUT method and all these snippets are uploading files using the POST method :s So it will be confusing cURL instead lol :p
 
Status
Not open for further replies.
Back
Top