ʵÀý½²½âphpʵÏÖÖÐÎÄˮӡµÄ´úÂë
ÒÔÏÂÊÇÀûÓÃphpʵÏÖÖÐÎÄˮӡµÄ´úÂë¡£
<?php
Header("Content-type: image/png"); /*֪ͨä¯ÀÀÆ÷,ÒªÊä³öͼÏñ*/
$im = imagecreate(400 , 300); /*¶¨ÒåͼÏñµÄ´óС*/
$gray = ImageColorAllocate($im , 235 , 235 , 235);
$pink = ImageColorAllocate($im, 255 , 128 , 255);
/*
$fontfile = "C:\WINDOWS\Fonts\SIMHEI.TTF";
²»ºÃÒâ˼,Õâ¾äÀÏÊÇÕ³ÉϺóÒ»Ìá½»¾Í¶ªÁË,²»ÖªµÀÊÇÔõô»ØÊÂ,Ïë²âÊÔµÄÅóÓÑÃǽ«×¢ÊÍÈ¥ÁËÏÖ²âÊÔ°É
*/
/* $fontfile ×ÖÌåµÄ·¾¶,ÊÓ²Ù×÷ϵͳ¶ø¶¨,¿ÉÒÔÊÇ simhei.ttf(ºÚÌå) , SIMKAI.TTF(¿¬Ìå) , SIMFANG.TTF(·ÂËÎ) ,SIMSUN.TTC(ËÎÌå&ÐÂËÎÌå) µÈ GD Ö§³ÖµÄÖÐÎÄ×ÖÌå*/
$str = iconv('GB2312','UTF-8','php°®ºÃÕßphpfans.net'); /*½« gb2312 µÄ×Ö·û¼¯×ª»»³É UTF-8 µÄ×Ö·û*/
ImageTTFText($im, 30, 0, 50, 140, $pink , $fontfile , $str);
/* ¼ÓÈëÖÐÎÄˮӡ */
Imagepng($im);
ImageDestroy($im);
?>
<?php
header("Content-type:image/png");
$pic=imagecreatefromjpeg("itwis.jpg");
$color1 = imagecolorallocate($pic,255,255,255);
$font1 = "C:\WINDOWS\Fonts\STZHONGS.TTF";
$info = "ITÖªµÀÍøitwis.com";
$info = iconv("GB2312","UTF-8",$info);
imagettftext($pic,12,0,10,20,$color1,$font1,$info);
imagepng($pic);
imagedestroy ($pic);
?>
±¾ÎÄÀ´×Ô: ITÖªµÀÍø(http://www.itwis.com) Ïêϸ³ö´¦²Î¿¼£ºhttp://www.itwis.com/html/php/phpskill/20080703/1925.html
Ïà¹ØÎĵµ£º
2009-08-03 16:05
|
6456´ÎÔĶÁ
|
¡¾ÒÑÓÐ2
ÌõÆÀÂÛ¡¿·¢±íÆÀÂÛ
¹Ø¼ü´Ê£ºPHP
| ¸Ðлydj9931
µÄÌṩ
|
ÊÕ²ØÕâƪÐÂÎÅ
¡¾Csdn
8ÔÂ3ÈÕ±¨µÀ¡¿PHP³ÉΪÊÀ½çÉÏ×îÁ÷ÐеĽű¾ÓïÑÔÓÐÐí¶àÔÒò£ºÁé»îÐÔ£¬Ò×ÓÃÐԵȵȡ£µ«Í¨³£Ö»ÓÃPHP»òÕßÆäËûÓïÑÔ±àÂë¾Í»áÏԵõ¥µ÷¡¢Öظ´£¬Õâ ......
HTTP Only cookies without PHP 5.2
by Matt Mecham
on September 12, 2006
For a while, Microsoft have had a flag
for cookies called ‘httponly’. This doesn’t sound particularly
exciting, but it is a vital step forward for web application security.
This flag tells Internet Expl ......
ÕâÊÇһЩʹÓÃƵÂʱȽϸߵĺ¯Êý£¬ÓеÄÀ´×Ô±ðÈ˵ijÌÐò......
1.²úÉúËæ»ú×Ö·û´®º¯Êý
function random($length) {
$hash = '';
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
$max = strlen($chars) - 1;
mt_srand((double)microtime() * 1000000);
for($ ......
<?php
function genPassword($min = 5, $max = 8)
{
$validchars="abcdefghijklmnopqrstuvwxyz123456789";
$max_char=strlen($validchars)-1;
$length=mt_rand($min,$max);
$password = "";
for($i=0;$i<$length;$i++)
{
$password.=$validchars[mt_rand(0,$max_char)] ......
×÷Ϊһ¸öȫеĻ¥ÁªÍøÏîÄ¿£¬ÓÐʱºò»áÃæÁÙÒ»¸öÑ¡ÔñʲôÑùµÄ¿ª·¢ÓïÑÔµÄÎÊÌâ¡£
ÎÒ˵µÄÕâ¸öÓÐʱºò£¬ÆäʵÊÇÖ¸ÏÖÓеÄÍŶÓÖУ¬Ã»Óм¼Êõ¿ª·¢µÄ³ÉÔ±µÄÇé¿ö¡£Èç¹ûÒѾÓÐÁËÒ»¸ö»òÕ߶à¸ö¼¼Êõ¿ª·¢ÈËÔ±£¬µ±È»ÊÇÑ¡ÔñÏÖÓгÉÔ±×îÊìϤºÍ×îÉó¤µÄÓïÑÔÁË¡£
ÄÇô¶ÔÓÚÒ»¸ö»¹Ã»Óм¼Êõ³ÉÔ±µÄÍŶӣ¬Ó¦¸ÃÑ¡ÔñʲôÑùµÄ¿ª·¢ÓïÑÔÄØ£¿»Ø´ðÕâ¸öÎÊÌ⣬Ê×Ï ......