Results 1 to 10 of 11
-
5th Nov 2010, 09:16 AM #1OPMemberWebsite's:
megahotfiles.comCould someone create a little script for me please :)
I'm not the best coder, I know php and html fairly well but no where near like a real coder.
I've created a form which creates a post for me, i'd like if I put a URL of a img in one of the input fields it will upload it to lulzimg...this probably takes some smart people 2-3min to do. Would anyone be able to assist me with it? I read that I need to use curl. I've never experienced any of that
I went into phpuploader and tried to take its script to see if I can make it work for me...I could not
Code:$postfields['image'] = "http://ia.media-imdb.com/images/M/MV5BMTkzNzY5OTc3Nl5BMl5BanBnXkFtZTcwNjE4NDQzMQ@@._V1._SX214_CR0,0,214,314_.jpg"; $postfields['submit'] = "submit"; $page = curl("http://lulzimg.com/app.php", $postfields, ""); preg_match('#http(.*)#', $page, $match); $imglink = trim($match[0]); echo $imglink;
i'm a complete nub so I really have no ideapisoj1 Reviewed by pisoj1 on . Could someone create a little script for me please :) I'm not the best coder, I know php and html fairly well but no where near like a real coder. I've created a form which creates a post for me, i'd like if I put a URL of a img in one of the input fields it will upload it to lulzimg...this probably takes some smart people 2-3min to do. Would anyone be able to assist me with it? I read that I need to use curl. I've never experienced any of that :( I went into phpuploader and tried to take its script to see if I can make it work for me...I Rating: 5
-
5th Nov 2010, 09:34 AM #2MemberWebsite's:
Elite.SO Defendos.com Motionite.comMaybe you can find something usefull from this:
PHP Code:<?php
// set url of image
$img = 'http://www.google.com/intl/en_ALL/images/srpr/logo1w.png';
// open url of API
$url = 'http://freedirectlink.com/tools/imageshack_api.php?img=' . $img;
// declare cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$site = curl_exec($ch);
curl_close($ch);
// decode output from API
$out = json_decode($site);
// echo result image only
echo $out->image;
?>
http://blog.smileylover.com/remote-u...-with-phpcurl/
EDIT: gunda316, im faster
-
5th Nov 2010, 09:38 AM #3You can call me G
Here's the code (with a function) :
PHP Code:function postHost($url, $data, $cookie, $credentials){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
if($cookie != "")
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
if($data != ""){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
if($credentials != ""){
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $credentials);
}
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
$page = curl_exec($ch);
curl_close($ch);
return $page;
}
$img = postHost("http://www.lulzimg.com/upload.php?submit=lulz&url=$url", "", "", "");
preg_match_all("/http:\/\/lulzimg.com\/[a-z0-9]+\/[a-z0-9A-Z.\-\[\]]+/", $img, $matches);
$link = $matches[0][1];
echo "Your link sir: $link";
My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz
-
5th Nov 2010, 09:38 AM #4OPMemberWebsite's:
megahotfiles.comThank you both so much
-
5th Nov 2010, 09:39 AM #5Member
l0calh0st : lulzimg doesn't return a json file after successful completion of upload..
http://lulzimg.com/app.php
will return the path of image in text .. so there no need to regex..Coding Horror Fan
I don't read PM's frequently .
-
5th Nov 2010, 09:43 AM #6OPMemberWebsite's:
megahotfiles.comsorry i'm quite a noob i'm trying to use gunda's but I can't figure out what variable is ment to be the URL of the image I want uploaded. Can anyone help with that?
-
5th Nov 2010, 09:45 AM #7
-
5th Nov 2010, 09:46 AM #8OPMemberWebsite's:
megahotfiles.comNVM I FIGURED IT OUT IT'S $URL ok it's working THANKS THANKS THANKS can't say that enough lol
-
5th Nov 2010, 09:49 AM #9
-
5th Nov 2010, 09:52 AM #10You can call me G
@desiboy: Do add the POST/GET fields accepted by app.php would help more.
My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Hiring] PHP Programmer to create script
By ChaoscripT in forum ServicesReplies: 0Last Post: 12th Apr 2012, 08:49 PM -
Anyone can create script like this?
By MediaStar in forum Web Application/Script SupportReplies: 12Last Post: 25th Feb 2012, 12:03 PM -
[Hiring] Looking for any one who can create script as like Adf.ly
By Pettrious in forum Completed TransactionsReplies: 10Last Post: 21st Feb 2012, 09:00 PM -
[Hiring] Coder to create custom script
By cyb3r in forum Completed TransactionsReplies: 1Last Post: 15th Sep 2011, 11:01 PM -
[Hiring] I am looking a programmer to create a script
By bestvideorap in forum Completed TransactionsReplies: 3Last Post: 22nd Aug 2011, 03:57 PM
themaPoster - post to forums and...
Version 5.23 released. Open older version (or...