ÍêÕûµÄPHPͼÐÎÑéÖ¤Âë³ÌÐòÔ´Â룡
´úÂëÈçÏÂ:
<?php
/* ÍøÕ¾ÑéÖ¤Âë³ÌÐò
* ÔËÐл·¾³£º PHP5.0.18 ϵ÷ÊÔͨ¹ý
* ÐèÒª gd2 ͼÐοâÖ§³Ö£¨PHP.INIÖÐ php_gd2.dll¿ªÆô£©
* ÎļþÃû: showimg.php
* ×÷Õߣº 17php.com
* Date: 2007.03
* ¼¼ÊõÖ§³Ö£º www.17php.com
*/
//Ëæ»úÉú³ÉÒ»¸ö4λÊýµÄÊý×ÖÑéÖ¤Âë
$num="";
for($i=0;$i<4;$i++){
$num .= rand(0,9);
}
//4λÑéÖ¤ÂëÒ²¿ÉÒÔÓÃrand(1000,9999)Ö±½ÓÉú³É
//½«Éú³ÉµÄÑéÖ¤ÂëдÈësession£¬±¸ÑéÖ¤Ò³ÃæÊ¹ÓÃ
Session_start();
$_SESSION["Checknum"] = $num;
//´´½¨Í¼Æ¬£¬¶¨ÒåÑÕɫֵ
Header("Content-type: image/PNG");
srand((double)microtime()*1000000);
$im = imagecreate(60,20);
$black = ImageColorAllocate($im, 0,0,0);
$gray = ImageColorAllocate($im, 200,200,200);
imagefill($im,0,0,$gray);
//Ëæ»ú»æÖÆÁ½ÌõÐéÏߣ¬Æð¸ÉÈÅ×÷ÓÃ
$style = array($black, $black, $black, $black, $black, $gray, $gray, $gray, $gray, $gray);
imagesetstyle($im, $style);
$y1=rand(0,20);
$y2=rand(0,20);
$y3=rand(0,20);
$y4=rand(0,20);
imageline($im,
Ïà¹ØÎĵµ£º
ŪÁ˰ëÌì, PHP ÖÕÓÚÄܵ÷ÓÃÎÒµÄC# dll ÁË.
¸ÃËÀµÄ,ÎÒ¶ÔC# COM×¢²áÒ»Ïò²»Á˽â, PHP ÎĵµÉÏÖ»¸øPHPÄDz¿·ÖÄÚÈÝ,û¸æËßÎÒÔõôŪdll
ÎÒ»¹ÉµÙâÙâµÄÓà Regsvr32 ×¢²áÄǸöc# dll.
±³¾°:
Windows xp sp3 ; apache 2.2.14 ; php 5.2.12 ;
VS2010 beta ;
ÓïÑÔ:
PHP5 , C#
C#²¿·Ö:
´´½¨Ò»¸ö C# Class Library . (dll) ......
SESSIONµÄʹÓÃ
SESSIONµÄ×÷Óúܶ࣬×î¶àÓõľÍÊÇÕ¾µãÄÚÒ³Ãæ¼ä±äÁ¿´«µÝ¡£ÔÚÒ³Ãæ¿ªÊ¼ÎÒÃÇÒªsession_start();
¿ªÆôSESSION£»
È»ºó¾Í¿ÉÒÔʹÓÃSESSION±äÁ¿ÁË£¬±ÈÈç˵Ҫ¸³Öµ¾ÍÊÇ£º$_SESSION['item']="item1";ÒªµÃµ½Öµ¾Í
ÊÇ$item1=$_SESSION['item'];£¬ºÜ¼òµ¥°É¡£ÕâÀïÎÒÃÇ¿ÉÄÜ»áʹÓõ½Ò»Ð©º¯Êý£¬±ÈÈç˵ÅжÏÊDz»ÊÇ
ijSESSION±ä ......
±¾ÎÄת×Ô http://hi.baidu.com/kxw102/blog/item/f1303188d9c148bb0e2444f2.html£¬¸Ðл×÷ÕߵķÖÏí
ÔÚ
PHP
ÖУ¬»ù±¾Êý¾Ý¿ÉÒÔ·ÖΪ³£Á¿ºÍ±äÁ¿Á½ÖÖ¡£³£Á¿ÃûºÍ±äÁ¿Ãûͨ³£³ÆÎª±êʶ·û¡£(
ÐèҪעÒâµÄÊDZêʶ·û±ØÐëÒÔ×Öĸ»òÕßÏ»®Ïß¿ªÍ·£¬²¢ÇÒÖ»ÄܰüÀ¨×Öĸ¡¢Êý×ÖºÍÏ»®Ïß
)
ÀýÈ磺
my_function¡¢Size¡¢
_BlackµÈµÈ
1.ÏÂÃæËµÏ ......
<?PHP
/**
* patServer
* PHP socket server base class
* Events that can be handled:
* * onStart
* * onConnect
* * onConnectionRefused
* * onClose
* * onShutdown
* * onReceiveData
*
* @version 1.1
* @author &n ......
www.diybl.com¡¡Ê±¼ä£º2008-06-01¡¡×÷Õß:ØýÃû
½«Æä±£´æ³ÉÒ»¸öÎļþ£¬ÓÃʱµ÷ÓÃ
<?
//ΪÁ˱ÜÃâÖØ¸´°üº¬Îļþ¶øÔì³É´íÎ󣬼ÓÁËÅжϺ¯ÊýÊÇ·ñ´æÔÚµÄÌõ¼þ£º
if(!function_exists(pageft)){
//¶¨Ò庯Êýpageft(),Èý¸ö²ÎÊýµÄº¬ÒåΪ£º
//$totle£ºÐÅÏ¢×ÜÊý£»
//$displaypg£ºÃ¿Ò³ÏÔʾÐÅÏ¢Êý£¬ÕâÀïÉèÖÃΪĬÈÏÊÇ20£»
//$url£º·Ö ......