bilis_money Posted October 23, 2007 Share Posted October 23, 2007 Hi i'm receiving this error message Warning: imagejpeg() [function.imagejpeg]: Unable to open 'http://www.golem.cc/converteddata/0000000296_Carlo_Brianza.JPG' for writing in /web/htdocs/www.golem.cc/home/convert-data.php on line 29 <?php ################################# # This pull all user info data and convert it into image. # ################################# /*steps 1. pull user info data. 2. replace all existing data images. (if possible use cron) 3. convert it into image 4. give name to image same as the user name 5. save it into directory. */ include "opendb.php"; function convert_data($idx, $lnamex, $fnamex, $birthdayx, $emailx, $hphonex, $wphonex, $addressx, $teamidx, $positionx, $numberx, $infox, $tagliax, $sport1x, $sport2x, $sport3x, $cittax, $likedinx, $photox) { $canvas = imagecreatetruecolor( 120, 170); $black = imagecolorallocate( $canvas, 0, 0, 0 ); $white = imagecolorallocate( $canvas, 255, 255, 255 ); imagefilledrectangle( $canvas, 2, 2, 118, 168, $white ); $font = "verdana.ttf"; $lname_txt = $lnamex; $size = "8"; $lname_x = 10; $lname_y = 15; imageTTFText( $canvas, $size, 0, $lname_x, $lname_y, $black, $font, $lname_txt ); //converted data info name. $path_con = 'http://' . $_SERVER['HTTP_HOST'] . '/converteddata/' . $photox; echo $path_con; imagejpeg($canvas, $path_con); ImageDestroy( $canvas ); } $query = "SELECT * FROM cclp_players"; $result = mysql_query($query) or die('Error, query failed'); $converted_data = 'http://' . $_SERVER['HTTP_HOST'] . '/converteddata/'; while(list($id, $lname, $fname, $birthday, $email, $hphone, $wphone, $address, $teamid, $position, $number, $info, $taglia, $sport1, $sport2, $sport3, $citta, $likedin, $photo) = mysql_fetch_array($result)) { convert_data($id, $lname, $fname, $birthday, $email, $hphone, $wphone, $address, $teamid, $position, $number, $info, $taglia, $sport1, $sport2, $sport3, $citta, $likedin, $photo); } ?> What do you think is the problem? Thank you very much in advance. Quote Link to comment https://forums.phpfreaks.com/topic/74408-warning-imagejpeg-functionimagejpeg-unable-to-open-for-writting-in/ Share on other sites More sharing options...
cooldude832 Posted October 23, 2007 Share Posted October 23, 2007 check premissions on that subfolder, if you can't write to it it can't be made. Also check that your path is valid Quote Link to comment https://forums.phpfreaks.com/topic/74408-warning-imagejpeg-functionimagejpeg-unable-to-open-for-writting-in/#findComment-375957 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.