Jump to content

Warning: imagejpeg() [function.imagejpeg]: Unable to open for writting in?


bilis_money

Recommended Posts

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.