Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PHP CookieÓëSession¿çÓò·ÃÎÊ¡¢´«µÝ


ÍíÉÏÌØÒ⻨Á˸öʱ¼ä£¬×Ô¼º¶¯ÊÖÊÔÁËÏ¡£
ÔÚÏîÄ¿ÖÐÒ»Ö±Åöµ½Cookie¿çÓò·ÃÎʼ°SessionId¿çÓò´«µÝÎÊÌâ
·¶Àý£º
index.php
<?php
include_once('a.php');
session_start();
$_SESSION['k'] = uniqid();
setcookie("sess", session_id(), time()+3600, "/", ".ipggg.com");
echo "index.php<br />\n";
echo $_SESSION['k'].'<br />';
echo "<mce:script src="http://www.ipggg.com/test/b.php" mce_src="http://www.ipggg.com/test/b.php"></mce:script>";
var_dump($_COOKIE);
echo "<br />\n";
?>
    
a.php
<?php
header('Content-type: text/html; charset=utf8');
/*
ÎÒ×¢Ê͵ôP3P»¹ÊÇ¿ÉÒÔ£¬ÄѵÀÊÇÒòΪÎÒRPÌ«¸ß£¿£¡
ÓÃIE7»òÕß»ðºü¶¼¿ÉÒÔ·ÃÎʵ½Öµ£»
ʹÓû·¾³Vista home + xampp-win32-1.7.1Ì××°
*/
//header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
/* memory_limitÊÇÉèÖÃPHPʹÓÃÄÚ´æʱ¿Õ¼ä£¬Ò»°ãÉèÖÃΪÄÚ´æµÄËÄ·ÖÖ®Ò»£¬Ó¦¸Ã¾Í²é²»¶àÁË¡£ */
@ini_set('memory_limit', '64M');
/* Ö¸¶¨»á»°Ä£¿éÊÇ·ñÔÚÇëÇó¿ªÊ¼Ê±×Ô¶¯Æô¶¯Ò»¸ö»á»°¡£Ä¬ÈÏΪ 0£¨²»Æô¶¯£©¡£ */
@ini_set('session.auto_start', 0);
/* ÒÔ·ÖÖÓÊýÖ¸¶¨»º³åµÄ»á»°Ò³ÃæµÄ´æ»îÆÚ£¬´ËÉ趨¶Ô nocache »º³å¿ØÖÆ·½·¨ÎÞЧ¡£Ä¬ÈÏΪ180 */
@ini_set('session.cache_expire', 180);
/* Ö¸¶¨ÊÇ·ñÆôÓÃ͸Ã÷ SID Ö§³Ö¡£Ä¬ÈÏΪ 0£¨½ûÓã©¡£
°üº¬×ŻỰÃûÒÔ¼°»á»° ID µÄ³£Á¿£¬¸ñʽΪ "name=ID"£¬»òÕßÈç¹û»á»° ID ÒѾ­ÔÚÊʵ±µÄ»á»° cookie ÖÐÉ趨ʱÔòΪ¿Õ×Ö·û´®¡£ */
@ini_set('session.use_trans_sid', 0);
/* Ö¸¶¨ÊÇ·ñÔÚ¿Í»§¶ËÓà cookie À´´æ·Å»á»° ID¡£Ä¬ÈÏΪ 1£¨ÆôÓã©¡£ */
@ini_set('session.use_cookies', 0);
/* ±êÖ¾×Å×÷Ϊ·ÃÎʵÄCookieÖ»ÄÜͨ¹ýHTTPЭÒé¡£²»¹ýʹÓÃAJAXÓÃPHP·ÃÎʾͿɣ¬´¿JavaScriptÎÞЧ£¡Ö»ÄÜ·À·¶Ò»µãµã£¬¶øÇÒ²»ÊÇËùÓÐä¯ÀÀÆ÷¶¼Ö§³Ö¡£ */
@ini_set("session.cookie_httponly", 1);
/* Õâ¸öÓ¦¸Ã²»Óöà˵£¬PHP´íÎó¿ª¹Ø */
@ini_set('display_errors', 1);
?>

b.php
<?php
include_once('a.php');
session_id($_COOKIE['sess']);
session_start();
setcookie("test", $_SESSION['k'], time()+3600, "/", ".ipggg.com");
?>

ÉèÖÃC:\WINDOWS\system32\drivers\etc\hosts
ÒýÓÃ
127.0.0.1 


Ïà¹ØÎĵµ£º

PHPÄ£°åÒýÇæSmarty»º´æÓ¦ÓÃ

1£ºsmarty »º´æµÄÅäÖÃ
      
Php´úÂë
$smarty->cache_dir = "/caches/"; //»º´æĿ¼
$smarty->caching = true; //¿ªÆô»º´æ,ΪflaseµÄʱºî»º´æÎÞЧ
$smarty->cache_lifetime = 60; //»º´æʱ¼ä
2:smarty»º´æµÄʹÓúÍÇå³ý
   
Php´úÂë
$smarty->di ......

PHPµÄOpenID¿â Community

Community-IDÊÇÒ»¸öʵÏÖÁË OpenID 2.0 ЭÒéµÄ PHP ¿â¡£
а汾ÔÚÓû§¹ÜÀí½çÃæÔö¼ÓÁËÒ»¸öÇå³ý°´Å¥£¬ÓÃÀ´Çå³ýËÑË÷ÊäÈë¿òµÄÄÚÈݺʹ洢ÔÚµ±Ç°¹ýÂËÆ÷ÁбíµÄÌõ¼þÐÅÏ¢£»¸üÐÂÁËÌáÐÑÓʼþÄ£°åµÄ·­ÒëÎı¾£»ä¯ÀÀÓû§ÁбíµÄʱºò½«ÔÚ״̬ÁÐÖÐÏÔʾÉÐδ¼¤»îµÄÓû§Êý£»Zend¿ò¼ÜÉý¼¶µ½ 1.9.2 °æ±¾£»ÐÞÕýÁËһЩbug¡£
ÏÂÔØ Community-ID 1.1.0 ......

2009Äê9ÔÂÓïÑÔÅÅÐаñ£ºPHP³¬Ô½C++


TIOBEÊÀ½ç±à³ÌÓïÑÔÅÅÐаñÕ¹ÏÖÁ˱à³ÌÓïÑÔµÄÁ÷ÐÐÇ÷ÊÆ¡£Ã¿¸öÔ£¬¶¼ÓÐ×îеÄÊý¾Ý±»¸üС£Õâ·ÝÅÅÐаñµÄÊý¾ÝÈ¡ÑùÀ´Ô´ÓÚ»¥ÁªÍøÉϸ»Óо­ÑéµÄ³ÌÐòÔ±¡¢ÉÌ ÒµÓ¦Óá¢ÖøÃûµÄËÑË÷ÒýÇ棨ÖîÈç¹È¸è¡¢ MSN ¡¢ÑÅ»¢£©µÄ¹Ø¼ü×ÖÅÅÃû¡¢ Alexa ÉϵÄÅÅÃûµÈ¡£Çë×¢ÒâÕâ¸öÅÅÐаñÖ»ÊÇ·´Ó³ÁËij¸ö±à³ÌÓïÑÔµÄÈÈÃÅ³Ì¶È , Õâ²¢²»´ú±íËüÊÇÒ»¸ö×îºÃµÄ±à³ÌÓïÑÔ» ......

AJAXÖÐÎÄÂÒÂëPHPÍêÃÀ½â¾ö

×î½üÔÚ×öÒ»¸öÏîÄ¿£¬Óöµ½AJAXÖÐÎÄÂÒÂëÎÊÌ⣬¾­¹ýÒ»¸öÏÂÎçµÄŬÁ¦ÖÕÓÚÍêÃÀ½â¾ö£¬ÏÖ½«ÐĵÃдÏÂÀ´£¬Ï£Íû¶ÔÄÇЩ»¹À§ÈÆÔÚÕâ¸öÎÊÌâ¶øÍ·Í´²»ÒѵÄÈËÃÇÓÐËù°ïÖú¡£
ÖÚËùÖÜÖª£¬Ê¹ÓÃAJAX´«ËͺͽÓÊÕÖÐÎIJÎÊýʱ£¬Èç¹û²»ÔÚ¿Í»§¶ËºÍ·þÎñÆ÷×öÏàÓ¦µÄ´¦Àí¾Í»á³öÏÖÂÒÂëÎÊÌ⣬ÔÚÍøÉÏÏàÓ¦µÄÎÄÕÂÒ²²»ÉÙ£¬µ«ÊÇÓеÄÇé¿öϺÜÄÑ´ÓÖÐÕÒµ½·ûºÏ×Ô¼ºÀíÏëµÄ´ð ......

¹ØÓÚPHPµÄ¼¸µãÎÊÌâ¼°½â¾ö·½·¨

1.ÅäÖÃIISϵÄPHP»·¾³
ÎÒÓõÄÊÇWindows server 2003+IIS 6.0+PHP,µ«¸Õ¿ªÊ¼ÓõÄPHP5.3£¬°´ÕÕÍøÉϵķ½·¨http://www.gzu521.com/campus/article/network/200902/182924.htmÒ»²½²½ÅäÖ㬵«Êǽá¹ûÔËÐгöÏÖÁËÒ»¸öÎÊÌ⣬¾ÍÊÇThe FastCGI Handler was unable to process the request.ÕÒÁ˺ܶà½â¾ö·½·¨µ«ÊÇ»¹ÊÇûÓнâ¾ö£¬×îºóÎÒ»»³É ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ