php session
ÍøÉÏ¿´ÁËsession.save_pathºÃÏñÕâ¸ösessionÎÒ»¹Ã»ÓÐÔõôÓùýÄØ£¬¿´À´ÓбØÒªÑо¿Ò»Ï°¡
½ñÌìÌØÒâµÄ¿´ÁËÒ»ÏÂÎĵµ£¬¿´Ò»ÏÂÎĵµÈ·ÊµÓÐÕâô¶«Î÷£¬Ò²Ã»Óп´µ½Ê²Ã´Àý×Ó¾Í×Ô¼ºËæ±ãµÄдÁËÒ»µã¿´¿´
´úÂëÈçÏ echo session.save_path
´ò¿ªä¯ÀÀÆ÷²é¿´¾¹È»ÏÔʾ sessionsave_path ²»¶Ô°¡£¬Ôõô»áÊÇÕâ¸öÄØ£¬¿´¿´»¹ÓÐsession.nameÄÇÎÒÏÔʾһÏÂÕâ¸ö°É
»¹ÊÇÏÔʾ sessionname ²»¶Ô°¡£¬Ä¬ÈÏÓ¦¸ÃÏÔʾµÄÊÇPHPSESSID ¿´À´¿Ï¶¨ÊÇÄÄÀï´íÁË°¡
ÒòΪ»¹ÓÐ˵¿´session_nameÄÇÎҾͿ´¿´Õâ¸öº¯ÊýÁË£¬ÏÔʾÕýÈ·¡£¿´À´ÉÏÃæµÄд·¨²»¶Ô°¡£¬¶à¿´ÁË¿´²Å·¢ÏÖÏÂÃæÓÐÀý×Ó£¬ÒªÏÔʾsession.save_pathҪʹÓÃini_get("session.save_path")ÊÔһϴúÂë¾Í¿ÉÒÔÁË
ÔÀ´ÊÇÕâÑùдµÄ°¡£¬¿´À´ÊÇÎÒÎÞÖªÁË¡£ÏëמÍÔÚÉèÖÃÒ»ÏÂsession.name°É£¬Í¨¹ýº¯Êýsession_name("PHPsid")
ͨ¹ýecho session_name("PHPsid") ÏÔʾµÄ»¹ÊǾɵģ¬ÒòΪ˵Ã÷ÉÏÊÇÕâÑù˵µÄ£¬ÒòΪ´úÂëÇ°ÎÒÒѾµ÷ÕûÓÃsession_start()ÎÒÔÚµ÷ÓÃsession_name()ÏÔʾµÄȷʵÊÇPHPsid¿ÉÊÇÎÒͨ¹ý²é¿´httpÍ·ÖеÄcookie¸ù±¾¾ÍûÓиıäÂð£¬ÄÇÎÒ´ò¿ª¸öIEÀ´ÊÔÊԲ鿴cookieÒ²ÊÇPHPSESSID¸ù±¾Ã»ÓиıäÂð£¬ÕâʱÎÒͻȻÏ൱ÁËÕâ¸ösession_name("PHPsid")ÔÚsession_startÇ°Ãæµ÷Óã¬Ò»²âÊÔ»¹ÊDz»ÐУ¬ÎÒÏëÓ¦¸ÃÊÇÒѾÓÐcookieµÄÎÊÌâ°É£¬ÎҹرÕIEÖØдò¿ªIE²âÊÔһϣ¬¿´CookieÕý³£ÁËȷʵÊÇPHPsidÁË£¬ÕâʱÎÒÔÙÈ¥¿´session_nameº¯ÊýµÄ˵Ã÷ʱ²Å·¢ÏÖÕâ¸öº¯ÊýÒªÉèÖõĻ°ÒªÔÚsession_startÇ°µ÷ÓõÄ
¿´À´ÊÇÎÒ×Ô¼º¿´µÄ²»×Ðϸ°¡£¬»¹ÊÇÒªÈÏÕæµÄ¿´°¡
Ïà¹ØÎĵµ£º
ÔÚа²×°ºÃµÄmysql £¬apahce£¬php µÄʱºò£¬Èç¹ûÔÚ´úÂëÖÐʹÓÃÁËsessions_start() µÄʱºò»á³öÏÖÀàËÆÒÔϵĴíÎó£º
Warning: session_start() [function.session-start]: Cannot send session cooki µÈµÄ´íÎó¡£
Çë°²×°ÈçϵÄ˼·ȥÐÞÕý£º
1.ÔÚphp.ini ÖÐÅäÖÃ session.savepath='/tmp'
2.¿ªÆôsession.auto_start=1
3.°Ñ¸ü¸Ä ......
PHPÖÐÓÐÏÂÁгÆ֮ΪħÊõ·½·¨(magic method)µÄº¯Êý:__construct, __destruct ,
__call, __callStatic,__get, __set, __isset, __unset , __sleep, __wakeup,
__toString, __set_state, __clone and __autoload,±¾ÎÄʹÓÃ__callΪʵÏÖÒ»¸öÉí·ÝÑéÖ¤µÄ¼òµ¥ÊµÀý£¬´úÂëÈçÏ£º ´úÂë<?php
interfa ......
ÔÚphpÖз¢ËÍÓʼþ¿ÉÒÔÓÃ×Ô´øµÄmail()º¯Êý£¬µ«ÊÇÕâ¸öº¯Êý²»×ãµãºÜÃ÷ÏÔ£¬×îÖ÷ÒªÊÇÔÛ±¾»úÉÏûÓа²×°smtp·þÎñ¾Íû·¨Ê¹ÓÃmail()¡£
µ±È»ÏÖÔÚ»¹ÓÐphpÆäËûµÄ²å¼þ¡¢ÀàʲôµÄ£¬ÄÇЩҲÐí¹¦ÄÜÆëÈ«£¬¿ÉÊÇÍâ¼Ó¾Í¸Ð¾õ²»Ë¬¡£
ÄÇÆäËû°ì·¨µÄ»°£¬Ò»°ã»áÏ뵽ͨ¹ýSMTP·þÎñÆ÷À´·¢ËÍÓʼþ£¬µ«ÊÇÒ²»á²úÉúһϵÁÐÎÊÌ⣨¾ßÌåÓÐÄÄЩÎÊÌâ¿É¼û²Î¿¼×ÊÁÏ"ÎÞÐ ......
1¡¢¹ýÂ˱êÇ©(HTML)£ºstrip_tags()
ÀýÈ磺
<?php
$text = '<?php ?><p>Test paragraph.</p><!-- Comment -
-> <a href=http://topic.csdn.net/u/20090311/09/"#fragment">Other text</a>';
echo strip_tags($text);
echo "\n";
// ÔÊÐíʹÓÃ<p>ºÍ<a>
echo stri ......