php sessionÐÂÊÖÈëÃŽ̳Ì
Session¼ò½é
session ·Ö³ÉÁ½²¿·Ö£¬session¿Õ¼ä´æ·ÅÓÚ·þÎñÆ÷¶Ë£¬´ò¿ª¿Õ¼äµÄID ´æ·ÅÓÚ ¿Í»§¶ËµÄcookie£¬ Èç¹û¿Í»§¶Ë¹Ø±ÕÁËcookie£¬session¾Í²»ÄÜÕý³£µÄʹÓá£
SessionµÄÖÐÎÄÒëÃû½Ð×ö“»á»°”£¬Æä±¾À´µÄº¬ÒåÊÇÖ¸ÓÐʼÓÐÖÕµÄһϵÁж¯×÷/ÏûÏ¢£¬±ÈÈç´òµç»°Ê±´ÓÄÃÆðµç»°²¦ºÅµ½¹Ò¶Ïµç»°ÕâÖмäµÄһϵÁйý³Ì¿ÉÒÔ³Æ֮Ϊһ¸ösession¡£Ä¿Ç°Éç»áÉ϶ÔsessionµÄÀí½â·Ç³£»ìÂÒ£ºÓÐʱºòÎÒÃÇ¿ÉÒÔ¿´µ½ÕâÑùµÄ»°“ÔÚÒ»¸öä¯ÀÀÆ÷»á»°Æڼ䣬...”£¬ÕâÀïµÄ»á»°ÊÇÖ¸´ÓÒ»¸öä¯ÀÀÆ÷´°¿Ú´ò¿ªµ½¹Ø±ÕÕâ¸öÆڼ䣻 Ò²¿ÉÒÔ¿´µ½“Óû§£¨¿Í»§¶Ë£©ÔÚÒ»´Î»á»°ÆÚ¼ä”ÕâÑùÒ»¾ä»°£¬Ëü¿ÉÄÜÖ¸Óû§µÄһϵÁж¯×÷£¨Ò»°ãÇé¿öÏÂÊÇͬij¸ö¾ßÌåÄ¿µÄÏà¹ØµÄһϵÁж¯×÷£¬±ÈÈç´ÓµÇ¼µ½Ñ¡¹ºÉÌÆ·µ½½áÕ˵dzöÕâÑùÒ»¸öÍøÉϹºÎïµÄ¹ý³Ì£»È»¶øÓÐʱºòÒ²¿ÉÄܽö½öÊÇÖ¸Ò»´ÎÁ¬½Ó£»ÆäÖеIJî±ðÖ»ÄÜ¿¿ÉÏÏÂÎÄÀ´ÍƶÏÁË¡£ ¡¡
¡¡È»¶øµ±sessionÒ»´ÊÓëÍøÂçÐÒéÏà¹ØÁªÊ±£¬ËüÓÖÍùÍùÒþº¬ÁË“ÃæÏòÁ¬½Ó”ºÍ/»ò“±£³Ö״̬”ÕâÑùÁ½¸öº¬Ò壬“ÃæÏòÁ¬½Ó”Ö¸µÄÊÇÔÚͨÐÅË«·½ÔÚͨÐÅ֮ǰҪÏȽ¨Á¢Ò»¸öͨÐŵÄÇþµÀ£¬±ÈÈç´òµç»°£¬Ö±µ½¶Ô·½½ÓÁ˵绰ͨÐŲÅÄÜ¿ªÊ¼¡£“±£³Ö״̬”ÔòÊÇָͨÐŵÄÒ»·½Äܹ»°ÑһϵÁеÄÏûÏ¢¹ØÁªÆðÀ´£¬Ê¹µÃÏûÏ¢Ö®¼ä¿ÉÒÔ»¥ÏàÒÀÀµ£¬±ÈÈçÒ»¸ö·þÎñÔ±Äܹ»ÈϳöÔٴιâÁÙµÄÀϹ˿Ͳ¢ÇҼǵÃÉÏ´ÎÕâ¸ö¹Ë¿Í»¹Ç·µêÀïÒ»¿éÇ®¡£ÕâÒ»ÀàµÄÀý×ÓÓГһ¸öTCP session”»òÕß“Ò»¸öPOP3 session”¡£ ¡¡
¡¡¼øÓÚÕâÖÖ»ìÂÒÒѲ»¿É¸Ä±ä£¬ÒªÎªsessionϸö¶¨Òå¾ÍºÜÄÑÓÐͳһµÄ±ê×¼¡£¶øÔÚÔĶÁsessionÏà¹Ø×ÊÁÏʱ£¬ÎÒÃÇÒ²Ö»Óп¿ÉÏÏÂÎÄÀ´ÍƶÏÀí½âÁË¡£²»¹ýÎÒÃÇ¿ÉÒÔÕâÑùÀí½â£ºÀýÈçÎÒÃÇ´òµç»°£¬´Ó²¦Í¨µÄÄÇÒ»¿ÌÆ𵽹Ҷϵ绰Æڼ䣬ÒòΪµç»°Ò»Ö±±£³Ö׎ÓͨµÄ״̬£¬ËùÒÔ°ÑÕâÖÖ½ÓͨµÄ״̬½Ð×ösession¡£ËüÊǷÿÍÓëÕû¸öÍøÕ¾½»»¥¹ý³ÌÖÐÒ»Ö±´æÔڵĹ«ÓбäÁ¿£¬ÔÚ¿Í»§¶Ë²»Ö§³ÖCOOKIEµÄʱºò£¬ÎªÁ˱£Ö¤Êý¾ÝÕýÈ·¡¢°²È«£¬¾Í²ÉÓÃSESSION±äÁ¿¡£·ÃÎÊÍøÕ¾µÄÀ´¿Í»á±»·ÖÅäÒ»¸öΨһµÄ±êʶ·û£¬¼´ËùνµÄ»á»° ID¡£ËüҪô´æ·ÅÔÚ¿Í»§¶ËµÄ cookie£¬ÒªÃ´¾ÓÉ URL ´«µÝ¡£ ¡¡
¡¡SESSIONµÄ·¢Ã÷Ìî²¹ÁËHTTPÐÒéµÄ¾ÖÏÞ£ºHTTPÐÒé±»ÈÏΪÊÇÎÞ״̬ÐÒ飬ÎÞ·¨µÃÖªÓû§µÄä¯ÀÀ״̬£¬µ±ËüÔÚ·þÎñ¶ËÍê³ÉÏìÓ¦Ö®ºó£¬·þÎñÆ÷¾ÍʧȥÁËÓë¸Ãä¯ÀÀÆ÷µÄÁªÏµ¡£ÕâÓëHTTPÐÒé±¾À´µÄÄ¿µÄÊÇÏà·ûµÄ£¬¿Í»§¶ËÖ»ÐèÒª¼òµ¥µÄÏò·þÎñÆ÷ÇëÇóÏÂÔØijЩÎļþ£¬ÎÞÂÛÊÇ¿Í»§¶Ë»¹ÊÇ·þÎñÆ÷¶¼Ã»ÓбØÒª¼Í¼±Ë´Ë¹ýÈ¥µÄÐÐΪ£¬Ã¿Ò»´ÎÇëÇóÖ®¼ä¶¼ÊǶÀÁ¢µÄ£¬ºÃ±È
Ïà¹ØÎĵµ£º
php google baidu ·ÖÒ³
<?php
/**
×÷Õߣº
äìÏ沩¿Í http://blog.csdn.net/fkedwgwy
ʱ¼ä£º
2009-11-26
php¼¼ÊõȺ£º
37304662
ʹÓ÷½·¨£º
include_once'Pager.class.php';
$pager=new Pager();
if(isset($_GET['page']))
$pager->setCurrentPage($_GET['page']);
else
$pager->setCurrentPage(1);
......
Õâ¶Îʱ¼äÔÚ¿´¡¶PHPºÍMySQL Web¿ª·¢¡·Ò»Êé¿´µ½str_replace½²½â£¬Ò»¶ÎСÌáʾдµ½£º¿ÉÒÔΪstr_replaceµÄÈý¸ö¶¼Ê¹ÓÃÊý×é´«È룬µ«½²½â±È½Ï¼òµ¥£¬ÓÚÊǾö¶¨×Ô¼ºµÄÊÔÑéһϸú¯ÊýÔÚ¸÷¸ö²ÎÊý´«ÈëÊý×éʱµÄÖ´Ðнá¹û¡£
º¯ÊýÔÐÍ£ºmixed str_replace(mixed needle,mixed new_needle,mixed haystack[,int &count]);
needle£ ......
<?php
// open database connection
@ $db = new mysqli($host, $user, $password, $database_name);
if (mysql_connect_error())
{
echo '';
exit;
}
// query
$result = $db->query($sql);
$num_results = $db->num_rows;
// data
$row = $result->fetch_assoc(); // row is array, $row['id' ......
javaÉÏ´«Îļþ
ÐèÒªµÄµÚÈý·½jar°üÓУ¨ÕâÀïʹÓÃapacheµÄ£©
apacheµÄcommons-fileupload£¨ÉÏ´«Óã©£¬commons-io £¨listenerÇåÀíÀàÓã© £¬ commons-beanutils£¨¿ÉÑ¡£©
¾ßÌå²Ù×÷
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
if(ServletFileUp ......