win+iis+php Architecture Web site does not show the verification code to solve the idea

Source: Internet
Author: User
win+iis+php Schema Web site does not display a verification code
http://www.xmfoodcn.com/system/login.php

Verification code does not display

Require_once '. /global.php ';

function King_ajax_salt () {
Global $king;
$id _fly=kc_post (' id ');
$id =substr ($id _fly,0,strlen ($id _fly)-4);
$salt =kc_random (12);
$js = "\$ (' #{$id}_salt '). Val (' {$salt} ');";
$s = "lang->get (' system/check/verifynew ')." \ "Src=\" ". $king->config (' inst ')." system/verify.php?salt={$salt}\ "/>";
$s. = "". $king->lang->get (' system/check/verifynew '). "";
Kc_ajax (', $s, 0, $JS);
}

function King_def () {

Global $king;
Header ("Cache-control:no-cache, must-revalidate"); http/1.1
Header ("Expires:mon, Jul 1997 05:00:00 GMT"); The past time

Header ("Content-type:image/png");

$salt =kc_get (' Salt ', 1, 1);

$width = $king->config (' verifywidth ');//Picture length
$height = $king->config (' verifyheight ');//Picture height
$size = $king->config (' verifysize ');//Text Size
$num = $king->config (' verifynum ');//Number of characters
$content = $king->config (' verifycontent ');//random characters

$array _content=explode (' | ', $content);
$array _content=array_diff ($array _content,array (null));
$array _font=kc_f_getdir (' System/verify_font ', ' TTF|TTC ');

$str = ";

$img =imagecreate ($width, $height);//Create a blank image
Imagefilledrectangle ($img, 0, 0, $width, $height, Imagecolorallocate ($img, 255,255,255));

Write
for ($i =0; $i < $num; $i + +) {
$code = $array _content[array_rand ($array _content)];
$str. = $code;//Verification Code character
$color =imagecolorallocate ($img, Rand (0,128), Rand (0,128), Rand (0,128));
$font = ' verify_font/'. $array _font[array_rand ($array _font)];//randomly read a font
$left =rand (Round ($size *0.2), round ($size *0.4)) + $i * $size;
Imagettftext ($img, rand (round ($size *0.7), $size), Rand ( -20,20), $left, Rand (round ($size *1.2), $size *1.4), $color, $ Font, $code);
}
Draw an asterisk
$max = $width * $height/400;
for ($i =0; $i < $max; $i + +) {
Imagestring ($img,, rand (0, $width), rand (0, $height), ' * ', rand (192,250));
}
Draw points
$max = $width * $height/40;
for ($i =0; $i < $max; $i + +) {
Imagesetpixel ($img, rand (0, $width), rand (0, $height), rand (1,200));
}
Draw Line
$max = $width * $height/800;
for ($i =0; $i < $max; $i + +) {
Imageline ($img, rand (0, $width), rand (0, $height), rand (0, $width), rand (0, $height), Rand (0,255));
}
Write the verification code into verify
$verify =new Kc_verify_class;
$verify->put ($salt, $STR);

Imagepng ($IMG);
Imagedestroy ($IMG);

$verify->clear ();
}
?>
------Solution--------------------
$s = file_get_contents (' Http://www.xmfoodcn.com/system/verify.php?salt=pkommyjkafe7 ');
Echo substr ($s, 3);
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.