Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Why can't I get image?
Old 06-06-2009, 07:54 PM Why can't I get image?
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
Here is my code(although I have tried a miriad of variations):
PHP Code:
$timeout 0// set to zero for no timeout 
curl_setopt ($chCURLOPT_URL"http://twitter.com/statuses/public_timeline.json"); 
curl_setopt ($chCURLOPT_RETURNTRANSFER1); 
curl_setopt ($chCURLOPT_CONNECTTIMEOUT$timeout); 
$twitter curl_exec($ch); 
curl_close($ch); 
$twitterArray json_decode($twitter); 
foreach (
$twitterArray as $tweet){ 
$i++; 
$user $tweet->user
$id[$i] = $user->id
$imageURL[$i] = "\"".$user->profile_image_url."\""
$url[$i] = $user->url
$name[$i] = $user->screen_name
$description[$i] = $user->description
$created[$i] = $user->created_at
$followers[$i] = $user->followers_count
$friends[$i] = $user->friends_count
 
echo(

<pre> 
Record #: 
$i<br> 
Image: 
$image[$i]<br> 
URL: 
$url[$i]<br> 
Name: 
$name[$i]<br> 
Description: 
$description[$i]<br> 
Created on: 
$created[$i]<br> 
Followers: 
$followers[$i]<br> 
Friends: 
$friends[$i]<br><br> 
</pre> 
"
); 
$ch curl_init(); 
curl_setopt ($chCURLOPT_RETURNTRANSFER1); 
curl_setopt ($chCURLOPT_BINARYTRANSFER1); 
curl_setopt ($chCURLOPT_URL,$imageURL[$i]); 
curl_setopt ($chCURLOPT_CONNECTTIMEOUT60); 
$imageData curl_exec($ch); 
echo 
'image is: 'htmlentities(substr($imageData04)), "...<br />\n"
curl_close($ch); 
$image imagecreatefromstring($imageData); 
$Orbimage "http://www.webmaster-talk.com/images/twitter/".$id[$i].".png"
$Orbback imagecreatefrompng("../images/main/OrbBack.png"); 
list(
$current_width$current_height) = getimagesize($twitterImage); 
$Orbfront imagecreatefrompng("../images/main/OrbFront.png"); 
imagecopy($Orbback,$imageData,50,50,$current_width/2,$current_height/2,$current_width,$current_height); 
imagecopy($Orbback,$Orbfront,0,0,0,0,100,100); 
imagesavealpha($Orbbacktrue); 
imagepng($Orbback,$Orbimage); 

 
?> 
here is the url: http://orbzorbz.com/php/twitterData.php

I am lost, have tried file_get_contents(url) with no luck and yes I have configured php to allow file open. ???
P.S. the string is indeed empty, even though i get no "cannot open url" error. I can enter url in browser and display image however!
So I guess the real question is why is it empty? I have put in an html "echo" to display pic, it works just fine, of course that is client side.
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!

Last edited by Sleeping Troll; 06-06-2009 at 08:02 PM..
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Why can't I get image?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18737 seconds with 12 queries