maj fichier README + css
[forum_heracles.git] / ecriremail.php
CommitLineData
dd62012c 1<?php
2
3if (isset($_REQUEST["ecrire"]))
4 $ecrire = $_REQUEST["ecrire"];
5else $ecrire = "@";
6
7$ecrire=str_rot13($ecrire);
8
9$fontsize = 10 ;
10
11$font = "/Applications/MAMP/htdocs/forumheracles/Vera.ttf" ;
12$angle = 0 ;
13$size = ImageTTFBBox( $fontsize, $angle, $font, $ecrire ) ;
14
15$widthExtra = $size[2] * 0.025 ;
16$width = round( $size[2] + $widthExtra ) ;
17$widthExtra = round( $widthExtra ) ;
18
19$heightExtra = ( abs( $size[5] ) + $size[3] ) * 0.15 ;
20$height = abs( $size[5] ) + $size[3] + $heightExtra ;
21$heightExtra = round( $heightExtra ) ;
22
23$text_x = round( $widthExtra / 2 ) ;
24$text_y = abs( $size[5] ) + round( $heightExtra / 2 ) ;
25
26$im = imagecreate( $width+2, $height+2) ;
27$bkgc = ImageColorAllocate( $im, 255, 255, 255 ) ;
28$txtc = ImageColorAllocate( $im, 0, 0, 0 ) ;
29ImageTTFText( $im, $fontsize, $angle, $text_x, $text_y, $txtc, $font, $ecrire ) ;
30
31Header( "Content-type: image/gif" ) ;
32Imagejpeg( $im ) ;
33ImageDestroy( $im ) ;
34
35?>