403Webshell
Server IP : 192.158.238.246  /  Your IP : 52.15.174.159
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/cpanel/ea-php81/root/usr/share/doc/pecl/imagick/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/cpanel/ea-php81/root/usr/share/doc/pecl/imagick/examples/captcha.php
<?php

/*
	A very primitive captcha implementation
*/

/* Create Imagick object */
$Imagick = new Imagick();

/* Create the ImagickPixel object (used to set the background color on image) */
$bg = new ImagickPixel();

/* Set the pixel color to white */
$bg->setColor( 'white' );

/* Create a drawing object and set the font size */
$ImagickDraw = new ImagickDraw();

/* Set font and font size. You can also specify /path/to/font.ttf */
$ImagickDraw->setFont( 'Helvetica Regular' );
$ImagickDraw->setFontSize( 20 );

/* Create the text */
$alphanum = 'ABXZRMHTL23456789';
$string = substr( str_shuffle( $alphanum ), 2, 6 );

/* Create new empty image */
$Imagick->newImage( 85, 30, $bg ); 

/* Write the text on the image */
$Imagick->annotateImage( $ImagickDraw, 4, 20, 0, $string );

/* Add some swirl */
$Imagick->swirlImage( 20 );

/* Create a few random lines */
$ImagickDraw->line( rand( 0, 70 ), rand( 0, 30 ), rand( 0, 70 ), rand( 0, 30 ) );
$ImagickDraw->line( rand( 0, 70 ), rand( 0, 30 ), rand( 0, 70 ), rand( 0, 30 ) );
$ImagickDraw->line( rand( 0, 70 ), rand( 0, 30 ), rand( 0, 70 ), rand( 0, 30 ) );
$ImagickDraw->line( rand( 0, 70 ), rand( 0, 30 ), rand( 0, 70 ), rand( 0, 30 ) );
$ImagickDraw->line( rand( 0, 70 ), rand( 0, 30 ), rand( 0, 70 ), rand( 0, 30 ) );

/* Draw the ImagickDraw object contents to the image. */
$Imagick->drawImage( $ImagickDraw );

/* Give the image a format */
$Imagick->setImageFormat( 'png' );

/* Send headers and output the image */
header( "Content-Type: image/{$Imagick->getImageFormat()}" );
echo $Imagick->getImageBlob( );

?>

Youez - 2016 - github.com/yon3zu
LinuXploit