📄 vvc.php
字号:
<?php
define('IN_SUBDREAMER', true);
$rootpath = "../";
// ########################### LOAD SUBDREAMER CORE ############################
include($rootpath . 'includes/core.php');
// ################################ FETCH VVCID ################################
$vvcid = isset($_POST['vvcid']) ? $_POST['vvcid'] : (isset($_GET['vvcid']) ? $_GET['vvcid'] : null);
if(isset($vvcid) && is_numeric($vvcid))
{
$verification_code = $DB->query_first("SELECT verifycode FROM " . TABLE_PREFIX . "vvc WHERE vvcid = $vvcid");
if(strlen($verification_code[0]) > 0)
{
/*header*/
Header("Content-Type: image/png");
$imwidth = 220;
$imheight = 40;
/* set up image, the first number is the width and the second is the height */
$im = ImageCreate($imwidth, $imheight);
$background_color = ImageColorAllocate ($im, 255, 255, 255);
$text_color = ImageColorAllocate ($im, 0, 0, 0);
$border_color = ImageColorAllocate ($im, 154, 154, 154);
//strip any spaces that may have crept in
//end-user wouldn't know to type the space! :)
$code = str_replace(" ", "", $verification_code[0]);
$x=0;
$stringlength = strlen($code);
for ($i = 0; $i< $stringlength; $i++)
{
$x = $x + (rand (8, 35));
$y = rand (2, 10);
$font = rand (2,25);
$single_char = substr($code, $i, 1);
imagechar($im, $font, $x, $y, $single_char, $text_color);
}
imagerectangle ($im, 2, 2, $imwidth-2, $imheight-2, $border_color);
/* output to browser*/
ImagePNG($im);
ImageDestroy($im);
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -