Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : php

php´óÎļþµÄÉÏ´«

1.ʹÓÃPHPµÄ´´Ê¼ÈË Rasmus Lerdorf дµÄAPCÀ©Õ¹Ä£¿éÀ´ÊµÏÖ£¨http://pecl.php.net/package/apc£©
APCʵÏÖ·½·¨£º
°²×°APC£¬²ÎÕÕ¹Ù·½Îĵµ°²×°£¬¿ÉÒÔʹÓÃPECLÄ£¿é°²×°·½·¨¿ìËÙ¼ò½Ý£¬ÕâÀﲻ˵Ã÷
ÅäÖÃphp.ini£¬ÉèÖòÎÊý apc.rfc1867=1 £¬Ê¹APCÖ§³ÖÉÏ´«½ø¶ÈÌõ¹¦ÄÜ£¬ÔÚAPCÔ´Âë˵Ã÷ÎĵµÀïÃæÓÐ˵Ã÷
´úÂë·¶Àý£º
¸´ÖÆPHPÄÚÈݵ½¼ôÌù°å
PHP´úÂë:
if
($_SERVER[‘REQUEST_METHOD‘] == ‘POST‘)
{
//ÉÏ´«ÇëÇó
$status = apc_fetch(‘upload_‘ . $_POST[‘APC_UPLOAD_PROGRESS‘]);
    $status[‘done‘] = 1;
    echo
json_encode($status);  //Êä³ö¸øÓû§¶ËÒ³ÃæÀïµÄajaxµ÷Óã¬Ïà¹ØÎĵµÇë×Ô¼ºÑ°ÕÒ
exit;
}
elseif
(isset($_GET[‘progress_key‘]))
{
//¶ÁÈ¡ÉÏ´«½ø¶È
$status = apc_fetch(‘upload_‘.$_GET[‘progress_key‘]);
    echo
json_encode($status);
    exit;
}
else
{
//ÆäËû´úÂ룬±ÈÈçÉÏ´«±íµ¥µÈ
}
2. ......

php ¹ºÎﳵʵÀý

php ¹ºÎﳵʵÀý
 <?php
/**
php ¹ºÎﳵʵÀý
ÍøÉÏËѵ½µÄ£¬¼òµ¥ÈÝÒ×Àí½â¡£cookie´æ¹ºÎï³µID£¬db´æ¹ºÎï³µÊý¾Ý¡£ ¹ºÎï³µsessionµÄ²úÉú´úÂë
*/
if(! $session && ! $scid) {
/*
sessionÓÃÀ´Çø±ðÿһ¸ö¹ºÎï³µ£¬Ï൱ÓÚÿ¸ö³µµÄÉí·ÝÖ¤ºÅ£»
scidÖ»ÓÃÀ´±êʶһ¸ö¹ºÎï³µidºÅ£¬¿ÉÒÔ¿´×öÊÇÿ¸ö³µµÄÃû×Ö£»
µ±¸Ã¹ºÎï³µµÄidºÍsessionÖµÁ½Õ߶¼²»´æÔÚʱ£¬¾Í²úÉúÒ»¸öйºÎï³µ
*/
$session = md5(uniqid(rand()));
/*
²úÉúÒ»¸öΨһµÄ¹ºÎï³µsessionºÅ
rand()ÏȲúÉú¸öËæ»úÊý£¬uniqid()ÔÙÔÚ¸ÃËæ»úÊýµÄ»ù´¡ÉϲúÉúÒ»¸ö¶ÀÒ»ÎÞ¶þµÄ×Ö·û´®£¬×îºó¶Ô¸Ã×Ö·û´®½øÐÐmd5
*/
SetCookie(scid, $session, time() + 14400);
/*
ÉèÖøùºÎï³µcookie
±äÁ¿Ãû£ºscid£¨²»Öªµ½ÕâÀïÊDz»ÊÇÉÙÁËÒ»¸ö $ºÅÄØ£¿=¡·¸üÕý£ºscidÒª¼Ó“”£©
±äÁ¿Öµ£º $session
ÓÐЧʱ¼ä£ºµ±Ç°Ê±¼ä+14400Ã루4СʱÄÚ£©
¹ØÓÚsetcookieº¯ÊýµÄÏêϸÓ÷¨£¬´ó¼Ò»¹ÊDzο´phpÊÖ²á°É~
*/
}
class Cart { //¿ªÊ¼¹ºÎï³µÀà
function check_item( $table, $session, $product) {
/*
²éÑéÎïÆ·(±íÃû£¬session£¬ÎïÆ·)
*/
$query = SELECT * from $table WHERE session=' $session' ......

PHPÈÕ³£¿ª·¢Ð¡¼¼ÇÉ

PHPÅúÁ¿È¡µÃcheckboxµÄÖµ
1¡¢ÃüÃû
<input type='checkbox' name='checkbox[]' value=$dwmyrow[banzhu] />
2¡¢Ê¹ÓÃ
µ±¼Æ»®µ±×÷sqlÖ¸ÁîµÄÒ»²¿·Öʱ£ºÈç¹û²ÎÓë¿ØÖƵÄ×Ö¶ÎÊÇÊýÖµÐ͵ģ¬Ôò
if(! empty($_POST['checkbox'])) {
$expr = join(",", $_POST['checkbox']);
$sql = "select * from tbl_name where field in ($expr)";
}
Èç¹û²ÎÓë¿ØÖƵÄ×Ö¶ÎÊÇÊýÖµÐ͵ģ¬Ôò
if(! empty($_POST['checkbox'])) {
$expr = "'".join("','", $_POST['checkbox']).".";
$sql = "select * from tbl_name where field in ($expr)";
}
PHPÅжÏForm±íµ¥ÊÇ·ñÌá½»
$action=$HTTP_POST_VARS["Button1"];
if($action=="Ìá½»")
{
//Ö´ÐÐ±íµ¥²Ù×÷
}
else
{
//¶ÁȡĬÈÏÖµ
}
PHP »ñÈ¡×Ö·û´®³¤¶È
strlen($myrow[1])
PHP UrlתÏò
Header("Location: ".$_SERVER["HTTP_REFERER"]);
PHP³¬È«¾Ö¶ÔÏó
<?php
$a = 1;
$b = 2;
function Sum()
{
$GLOBALS["b"] = $GLOBALS["a"] $GLOBALS["b"];
}
Sum();
echo $b;
?>
PHP ±íµ¥È¡Öµ
Èç¹û mothod="get" ¾ÍÓà $_GET["test"] ´úÌæ$test
Èç¹û mothod="post" ¾ÍÓà $_POST["test"] ´úÌæ$test
PHPÈ¡µÃµ±Ç°IP
<?=$HTTP ......

PHP5ÃæÏò¶ÔÏó£ºObject Cloning

PHP4:
<?
$sample1 = new StdClass();
$sample1->name = "Hasin";
$sample2 = $sample1;
$sample2->name = "Afif";
echo $sample1->name;
?>
In PHP4 it works differently; it will output Hasin, as both are different from 
each other.
PHP5:
<?
$sample1 = new StdClass();
$sample1->name = "Hasin";
$sample2 = $sample1;
$sample2->name = "Afif";
echo $sample1->name;
?>
The output is Afif
PHP5:
<?
$sample1 = new stdClass();
$sample1->name = "Hasin";
$sample2 =clone $sample1;
$sample2->name = "Afif";
echo $sample1->name;
?>
The output now would be Hasin.
__clone·½·¨µÄʹÓÃ
ĬÈϵØ,ÓÃ__clone·½·¨½«½¨Á¢Ò»¸öÓëÔ­¶ÔÏóÓµÓÐÏàͬÊôÐԺͷ½·¨µÄ¶ÔÏó. Èç¹ûÄãÏëÔÚ¿Ë¡ʱ¸Ä±äĬÈϵÄÄÚÈÝ,ÄãÒªÔÚ__cloneÖи²Ð´(ÊôÐÔ»ò·½·¨).
¿Ë¡µÄ·½·¨¿ÉÒÔûÓвÎÊý,µ«Ëüͬʱ°üº¬thisºÍthatÖ¸Õë(thatÖ¸Ïò±»¸´ÖƵĶÔÏó). Èç¹ûÄãÑ¡Ôñ¿Ë¡×Ô¼º,ÄãҪСÐĸ´ÖÆÈκÎÄãÒªÄãµÄ¶ÔÏó°üº¬µÄÐÅÏ¢,´Óthatµ½this. Èç¹ûÄãÓÃ__cloneÀ´¸´ÖÆ. PHP²»»áÖ´ÐÐÈκÎÒþÐԵĸ´ÖÆ,
ÏÂÃæÏÔʾÁËÒ»¸öÓÃϵÁÐÐòÊýÀ´×Ô¶¯ ......

PHP³ÌÐò61ÌõÃæÏò¶ÔÏó·ÖÎöÉè¼ÆµÄ¾­ÑéÔ­Ôò (ת)

 
Äã²»±ØÑϸñ×ñÊØÕâЩԭÔò£¬Î¥±³ËüÃÇÒ²²»»á±»´¦ÒÔ×Ú½ÌÐÌ·£¡£µ«ÄãÓ¦µ±°ÑÕâЩԭÔò¿´³É¾¯Á壬ÈôÎ¥±³ÁËÆäÖеÄÒ»Ìõ£¬ÄÇô¾¯Áå¾Í»áÏìÆð ¡£ ----- Arthur J.Riel
 
(1)ËùÓÐÊý¾Ý¶¼Ó¦¸ÃÒþ²ØÔÚËùÔÚµÄÀàµÄÄÚ²¿¡£
 
(2)ÀàµÄʹÓÃÕß±ØÐëÒÀÀµÀàµÄ¹²Óнӿڣ¬µ«À಻ÄÜÒÀÀµËüµÄʹÓÃÕß¡£
 
(3)¾¡Á¿¼õÉÙÀàµÄЭÒéÖеÄÏûÏ¢¡£
 
(4)ʵÏÖËùÓÐÀ඼Àí½âµÄ×î»ù±¾¹«ÓнӿÚ[ÀýÈ磬¿½±´²Ù×÷(É±´ºÍdz¿½±´)¡¢ÏàµÈÐÔÅжϡ¢ÕýÈ·Êä³öÄÚÈÝ¡¢´ÓASCIIÃèÊö½âÎöµÈµÈ]¡£
 
(5)²»Òª°ÑʵÏÖϸ½Ú(ÀýÈç·ÅÖù²ÓôúÂëµÄ˽Óк¯Êý)·Åµ½ÀàµÄ¹«ÓнӿÚÖС£
 
Èç¹ûÀàµÄÁ½¸ö·½·¨ÓÐÒ»¶Î¹«¹²´úÂ룬ÄÇô¾Í¿ÉÒÔ´´½¨Ò»¸ö·ÀÖ¹ÕâЩ¹«¹²´úÂëµÄ˽Óк¯Êý¡£
 
(6)²»ÒªÒÔÓû§ÎÞ·¨Ê¹Óûò²»¸ÐÐËȤµÄ¶«Î÷ÈÅÂÒÀàµÄ¹«Óнӿڡ£
 
(7)ÀàÖ®¼äÓ¦¸ÃÁãñîºÏ£¬»òÕßÖ»Óе¼³öñîºÏ¹Øϵ¡£Ò²¼´£¬Ò»¸öÀàҪôͬÁíÒ»¸öÀàºÁÎÞ¹Øϵ£¬ÒªÃ´Ö»Ê¹ÓÃÁíÒ»¸öÀàµÄ¹«ÓнӿÚÖеIJÙ×÷¡£
 
(8)ÀàÓ¦¸ÃÖ»±íʾһ¸ö¹Ø¼ü³éÏó¡£
 
°üÖеÄËùÓÐÀà¶ÔÓÚͬһÀàÐÔÖʵı仯Ӧ¸ÃÊǹ²Í¬·â±ÕµÄ¡£Ò»¸ö±ä»¯Èô¶ÔÒ»¸ö°üÓ°Ï죬Ôò½«¶Ô°üÖеÄËùÓÐÀà²úÉúÓ°Ï죬¶ø¶ÔÆäËûµÄ°ü²»¡¡¡¡Ôì³ÉÈκÎÓ°Ïì .
 
(9)°ÑÏà¹ØµÄÊý¾ÝºÍÐÐÎ ......

ÅäÖÃFCKÉÏ´«£¨PHP£©


ҪʹÄúµÄFCKeditorÄܹ»Ê¹ÓÃÉÏ´«¹¦ÄÜ£¬Äú±ØÐë½øÐÐÒÔÏÂÅäÖÆ¡£
×¢Ò⣺FCKeditor²»Ö§³ÖÐéÄâĿ¼£¬ÄúµÄ·¾¶ÉèÖö¼ÊÇÕë¶ÔÍøÕ¾¸ùĿ¼µÄ¾ø¶Ô·¾¶¶øÑԵġ£Õâµã¶ÔÓÚ·¢²¼µ½Ô¶³ÌÍøվĿ¼µÄ¿ª·¢Õß¼«Îª²»±ã£¬ºóÃæÎÒÃÇ»á¶Ô´Ë½øÐÐÌÖÂÛ¡£
Ò»¡¢´ò¿ªfckeditor\editor\filemanager\upload\php\config.php£¬ÕÒµ½´úÂë$Config['Enabled']£¬½«ÖµÉèÖÃΪtrue¡£
¶þ¡¢½ÓÏÂÀ´¼¸ÐУ¬ÉèÖÃ$Config['UserFilesPath']£¬ÉèÖÃÉÏ´«Â·¾¶¡£
Èý¡¢´ò¿ªfckeditor\fckconfig.jsÎļþ£¬ÕÒµ½´úÂë_FileBrowserLanguage£¬½«ÖµÉèÖÃΪphp¡£½ÓÏÂÀ´Ò»ÐУ¬°Ñ_QuickUploadLanguageÖµÒ²ÉèÖÃΪphp¡£
ÅäÖÃÎļþä¯ÀÀ
Ò»¡¢´ò¿ªfckeditor\editor\filemanager\browser\default\connectors\php\config.php
ÕÒµ½´úÂë$Config['Enabled']£¬½«ÖµÉèÖÃΪtrue;
¶þ¡¢½ÓÏÂÀ´¼¸ÐУ¬ÉèÖÃ$Config['UserFilesPath']£¬ÉèÖÃä¯ÀÀ·¾¶¡£
¹ØÓÚÉÏ´«\Îļþä¯ÀÀ°²È«ÐÔÎÊÌâ
ΪÁ˽â¾öFCKeditor²»Ö§³ÖÐéÄâĿ¼ÎÊÌ⣬ºÍFCKeditorÎļþÉÏ´«µÄ°²È«ÐÔ¿¼Á¼¡£ÎÒÃÇÓбØÒªÔÚÕâÀïµ¥Â۶Դ˽øÐÐÌÖÂÛ¡£
       ´ò¿ªfckeditor\editor\filemanager\upload\php\config.php£¬ÕÒµ½$Config['UserFilesPath']´úÂ룬ÔÚ´ËÐдúÂë֮ǰ¶¨Òå±äÁ¿$root_p ......
×ܼǼÊý:2174; ×ÜÒ³Êý:363; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [352] [353] [354] [355] 356 [357] [358] [359] [360] [361]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ