kam1313 Posted December 22, 2009 Share Posted December 22, 2009 Hi, I'm getting this error with my captcha php page: Warning: Wrong parameter count for imagettfbbox() I'm using PHP version 5.0.5 and GD is enabled. Many thanks Link to comment https://forums.phpfreaks.com/topic/186093-captcha-error/ Share on other sites More sharing options...
trq Posted December 22, 2009 Share Posted December 22, 2009 The error is pretty self explanatory. Your not passing the correct amount of arguments to the imagettfbbox() function. Link to comment https://forums.phpfreaks.com/topic/186093-captcha-error/#findComment-982747 Share on other sites More sharing options...
kam1313 Posted December 22, 2009 Author Share Posted December 22, 2009 Hi, The code is as follows: var $font = 'times.ttf'; /* create textbox and add text */ $textbox = imagettfbbox($font_size, 0, $this, $font, $code) or die('Error in imagettfbbox function'); $x = ($width - $textbox[4])/2; $y = ($height - $textbox[5])/2; I'm still not sure where I'm going wrong as I have changed fonts aswell. Thanks for your help Link to comment https://forums.phpfreaks.com/topic/186093-captcha-error/#findComment-982753 Share on other sites More sharing options...
trq Posted December 22, 2009 Share Posted December 22, 2009 You are passing 5 argument to imagettfbbox, it only accepts 4. Link to comment https://forums.phpfreaks.com/topic/186093-captcha-error/#findComment-982755 Share on other sites More sharing options...
kam1313 Posted December 22, 2009 Author Share Posted December 22, 2009 Thanks for the information. Being new to PHP I wasn't sure what to take out so I deleted the die part. Now the error is: Warning: Wrong parameter count for imagettfbbox() Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/186093-captcha-error/#findComment-982760 Share on other sites More sharing options...
trq Posted December 23, 2009 Share Posted December 23, 2009 The problem is you are passing 5 arguments to imagettfbbox, it only accepts 4. The die part has nothing to do with it. Take a look at the link I've provided. Link to comment https://forums.phpfreaks.com/topic/186093-captcha-error/#findComment-982761 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.