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
Ïà¹ØÎĵµ£º
64λ¶¯Ì¬phpÀ©Õ¹¿âµÄ±àÒë
¹¤×÷ÉÏÐèÒª£¬Õâ¸öÎÊÌâÕÛÌÚÁËÒ»Õó×Ó¡£²»¹ýµ±±àÒë³É¹¦Ö®ºó£¬ÐÄÀﻹÊÇÏ൱µÄÐË·Ü£¬¸ÐÊܵ½ÁËÒ»Öֳɾ͸С£Ò²Êǹ¤×÷ÖеÄÒ»ÖÖÀÖȤ¡£
ÏÖÔÚ½«Õû¸ö¹ý³ÌдÏÂÀ´£¬ÒÔ±¸ºóÐøÖ®Ðè¡£
a.shared object
(1) download and install the apache
´ÓÍøÂçÖÐÏÂÔØapache-2.0.48.tar.gz
´æÖÁ/home/tmp
cd /home/ ......
PHP 5.3.1·¢²¼ÁË£¡´Ë´Î²¢Ã»ÓÐÔö¼Ó¶àÉÙÐÂÌØÐÔ£¬Ö÷ÒªÊǹ¦ÄܵĸĽøºÍbugµÄÐÞ¸´£º
ÐÂÔöÁËÒ»¸ömax_file_uploads²ÎÊý£¬ÓÃÓÚÏÔʾÿ¸öÇëÇóÉÏ´«ÎļþµÄ¸öÊý
ÐÂÔöÁËÔÙ´¦Àí¹ý³ÌÖеÄÍêÕûÐÔ¼ì²â
ÐÞ¸´ÁË´«µÝtempnam()º¯Êýʱsafe_modeÖеÄÎÊÌâ
ÐÞ¸´ÁË´«µÝposix_mkfifo()ʱopen_basedirÖеÄÎÊÌâ
ÐÞ¸´ÁËsafe_mode_include_dirÖеÄÎ ......
#ÕÒµ½:
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gz ......
1 °²×°MySQL5
ÓÃÏÂÁÐÃüÁî°²×°MySQL£º
yum install mysql mysql-server
È»ºóÎÒÃÇΪMySQL´´½¨ÏµÍ³Æô¶¯Á´½Ó£¨ÕâÑùµÄ»°£¬MySQL¾Í»áËæ×ÅϵͳÆô¶¯¶øÆô¶¯£©£¬²¢Æô¶¯MySQL·þÎñÆ÷£º
chkconfig –levels 235 mysqld on
/etc/init.d/mysqld start
ÔËÐÐ
mysqladmin -u root password yourrootsqlpassword
À´ÎªrootÓû§ÉèÖà ......