image.php
来自「验证规则 jquery-validate」· PHP 代码 · 共 35 行
PHP
35 行
<?php// Begin the sessionsession_start();// If the session is not present, set the variable to an error messageif(!isset($_SESSION['captcha_id'])) $str = 'ERROR!';// Else if it is present, set the variable to the session contentselse $str = $_SESSION['captcha_id'];// Set the content type//header('Content-type: image/png');header('Cache-control: no-cache');// Create an image from button.png$image = imagecreatefrompng('button.png');// Set the font colour$colour = imagecolorallocate($image, 183, 178, 152);// Set the font$font = '../fonts/Anorexia.ttf';// Set a random integer for the rotation between -15 and 15 degrees$rotate = rand(-15, 15);// Create an image using our original image and adding the detailimagettftext($image, 14, $rotate, 18, 30, $colour, $font, $str);// Output the image as a pngimagepng($image);?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?