PHPʵÀý£ºÓÃSESSION·½·¨ÊµÏÖÑéÖ¤Âë
index.php(ʵÏÖÊäÈëÑéÖ¤ÂëÒ³Ãæ)´úÂëÈçÏ£º Code´úÂëÈçÏÂ: <html>
<head>
<title>check code</title>
</head>
<body>
<form name=check method=post action=check.php>
<input type=hidden name=init value=1>
ÑéÖ¤Â룺<input type=text name=code maxlength=4 style="width=50px;">
<!--µÃµ½ÑéÖ¤ÂëͼƬ-->
<img src=image.php>
<p>
<input type=submit value="Ìá½»">
</form>
</body>
</html> image.php£¨ÑéÖ¤ÂëÉú³ÉÒ³Ãæ£©´úÂëÈçÏ£º Code´úÂëÈçÏÂ: <?php
session_start();
srand((double)microtime()*1000000);
$authnum=rand(1000,9999);
session_register("authnum");
header("content-type:image/png");
function creat_image( $width, $height, $authnum)
{
srand((double)microtime()*1000000);
$im = imagecreate( $width, $height);
$black = ImageColorAllocate( $im, 0,0,0);
$white = ImageColorAllocate( $im, 255,255,255);
$gray = ImageColorAllocate( $im, 200,200,200);
imagefill( $im,0,0, $gray);
//½«ËÄλÕûÊýÑéÖ¤Âë»æÈëͼƬ
imag
Ïà¹ØÎĵµ£º
PHPÊǸöΰ´óµÄweb¿ª·¢ÓïÑÔ£¬Áé»îµÄÓïÑÔ£¬µ«ÊÇ¿´µ½php³ÌÐòÔ±Öܶø¸´Ê¼µÄ·¸µÄһЩ´íÎó¡£ÎÒ×öÁËÏÂÃæÕâ¸öÁÐ±í£¬ÁгöÁËPHP³ÌÐòÔ±¾³£·¸µÄ10ÖдíÎ󣬴ó¶àÊýºÍ°²È«Ïà¹Ø¡£¿´¿´Äã·¸Á˼¸ÖÖ
1.²»×ªÒâhtml entities
Ò»¸ö»ù±¾µÄ³£Ê¶£ºËùÓв»¿ÉÐÅÈεÄÊäÈë£¨ÌØ±ðÊÇÓû§´ÓformÖÐÌá½»µÄÊý¾Ý£© £¬Êä³ö֮ǰ¶¼Òª×ªÒâ¡£
echo $_GE ......
ÔÎÄÄÚÈÝ
£º
ͻ񻣼
½ÏÔçµÄʱºò£¬ÓиöÅóÓѼ«Á¦ÍƼöÎÒÈ¥¿´¿´Ò»¿îPHPÎʾíµ÷²éϵͳ¡£ÎÒËäÈ»´ÓÊÂÈí¼þÁìÓòµÄʱ¼ä
²¢²»Ì«³¤£¬µ«Ò²ÖªµÀ¹úÄÚÔÚÕâ¸öÁìÓòÑо¿ºÍ´ÓÊÂµÄÆóÒµºÍ¸öÈ˲¢²»ÉÙ£¬Ö®Ç°Ò²¹Ø×¢¹ýºÍÆÀ¹À¹ýһЩ²úÆ·»òϵͳ£¬×ÜÌåÉÏ¿´À´£¬´ó¶àÊý²úÆ·µÄÉÌÒµ»¯³Ì¶È²»¸ß£¬ÖÊÁ¿²Î
²î²»Æë£¬Àë³ÉÊìµÄÈí¼þϵͳ»¹ÓÐÏ൱һ¸ö¾àÀë¡ ......
//Ï뿴ʲôµç×ÓÊ飬ÏÈÈ¥ÐÂÀ˶ÁÊéËÑË÷£¬È»ºóÌîÈë¶ÔÓ¦µÄ²ÎÊý¼´¿É
//http://vip.book.sina.com.cn/
//µç×ÓÊé²ÎÊý
$array_book[0] = 38884; //С˵id
$array_book[1] = 22172; //ÕÂ½ÚÆðʼid
$array_book[2] = 32533; //Õ½ڽáÊøid
$array_book[3] = 'ÖйúÌØÖÖ²¿¶Ó ......
//
dirname()
// Returns directory name component of path
basename()
// Returns filename component of path
pathinfo()
// Returns information about a file path;
// pathinfo() returns an associative array containing information about path .
parse_url()
// Parse a URL and return its comp ......