Call to undefined function imageloadfont() ?

Discussion in 'PHP' started by thesurface, Mar 27, 2010.

  1. #1
    hello i have script from php.net but not works :(
    also can i install GD from cpanel? please how?

      <?php
    // Create a new image instance
    $im = imagecreatetruecolor(50, 20);
    $black = imagecolorallocate($im, 0, 0, 0);
    $white = imagecolorallocate($im, 255, 255, 255);
    
    // Make the background white
    imagefilledrectangle($im, 0, 0, 49, 19, $white);
    
    // Load the gd font and write 'Hello'
    $font = imageloadfont('./04b.gdf');
    imagestring($im, $font, 0, 0, 'Hello', $black);
    
    // Output to browser
    header('Content-type: image/png');
    
    imagepng($im);
    imagedestroy($im);
    ?>       
    PHP:

     
    thesurface, Mar 27, 2010 IP
  2. Alex Roxon

    Alex Roxon Active Member

    Messages:
    424
    Likes Received:
    11
    Best Answers:
    7
    Trophy Points:
    80
    #2
    Contact your host.
     
    Alex Roxon, Mar 27, 2010 IP
  3. dhvanit

    dhvanit Peon

    Messages:
    137
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yeah ask your hosting provider and check if GD library is configure proper.

    Cheers
     
    dhvanit, Mar 27, 2010 IP