国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

There is a problem with the final call of php to implement image verification code?
羅梅光
羅梅光 2022-05-05 01:22:00
0
8
1263

According to php how to implement image verification code content guide encapsulation verification code class capt 0.png capt1 0.png

羅梅光
羅梅光

reply all(4)
autoload
//設(shè)置字體的路徑?
$font='./Daft-Font-1.ttf';
?//添加內(nèi)容
??$content="hello?word!";?
??//設(shè)置字體的顏色和透明度?
??$col=imagecolorallocatealpha($image,255,255,5,1);?
??//寫入文字?
??imagettftext($image,20,0,60,60,$col,realpath($font),$content);
autoload

Use realpath() for the font path to convert the relative path to an absolute path

  • reply Thanks for the reply, sir. The image is generated now, but it cannot be displayed on the page. It is only displayed on the network. Try ob_clean(); later.
    羅梅光 author 2022-05-05 12:48:07
  • reply Boss, I tried ob_clean(); but it didn’t work either. The image is now generated, but it cannot be displayed on the page. It is only displayed on the network.
    羅梅光 author 2022-05-05 13:38:13
  • reply How to separate the front-end and back-end to display the returned image on the page img.
    羅梅光 author 2022-05-05 13:38:59
  • reply Solved, thank you php.cn boss. ob_start(); imagepng($img); $image_data = ob_get_contents(); ob_end_clean(); $base64 = chunk_split(base64_encode($image_data)); return 'data:image/png;base64,' . $base64;
    羅梅光 author 2022-05-05 14:20:40
羅梅光

Is the font font file not found? Where can I find the font files?

羅梅光

http://www.miracleart.cn/php-ask-482565.html

The hyperlink on the page has disappeared, please add it.

How to implement image verification code in php

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template