Windows + iis + php architecture websites do not display verification codes. how can this problem be solved?

Source: Internet
Author: User
The Windows + iis + php architecture website does not display the verification code http://www.xmfoodcn.com/system/login.php   do not display the verification code &lt ;? Phprequire_once & nbsp; '../global. php'; the Windows + iis + php architecture website does not display the verification code.
Http://www.xmfoodcn.com/system/login.php

The verification code is not displayed.

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, 26 Jul 1997 05:00:00 GMT"); // past time

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

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

$ Width = $ king-> config ('verifywidth'); // The Image length.
$ Height = $ king-> config ('verifyheight'); // The Image height.
$ Size = $ king-> config ('verifysize'); // text size
$ Num = $ king-> config ('verifynum'); // number of texts
$ Content = $ king-> config ('verifycontent'); // random character

$ 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, 15, rand (0, $ width), rand (0, $ height), '*', rand (192,250 ));
}
// Draw Point
$ Max = $ width * $ height/40;
For ($ I = 0; $ I <$ max; $ I ++ ){
ImageSetPixel ($ img, rand (0, $ width), rand (0, $ height), rand (1,200 ));
}
// Draw a 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 to verify
$ Verify = new KC_Verify_class;
$ Verify-> Put ($ salt, $ str );

ImagePng ($ img );
ImageDestroy ($ img );

$ Verify-> Clear ();
}
?> PHP verification code
------ 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.