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

php headerÏê½â


header
(PHP 3, PHP 4, PHP 5)
header -- ·¢ËÍÒ»¸öԭʼ HTTP ±êÍ·
˵Ã÷
void header ( string string [, bool replace [, int http_response_code]] )
header() º¯ÊýÓÃÀ´·¢ËÍÒ»¸öԭʼ HTTP ±êÍ·¡£ÓÐ¹Ø HTTP ±êÍ·µÄ¸ü¶àÄÚÈݼû HTTP/1.1 ¹æ·¶¡£
¿ÉÑ¡²ÎÊý replace Ö¸Ã÷ÊÇÌæ»»µôÇ°Ò»ÌõÀàËƵıêÍ·»¹ÊÇÔö¼ÓÒ»ÌõÏàͬÀàÐ͵ıêÍ·¡£Ä¬ÈÏΪÌæ»»£¬µ«Èç¹û½«ÆäÉèΪ FALSE Ôò¿ÉÒÔÇ¿ÖÆ·¢ËͶà¸öͬÀà±êÍ·¡£ÀýÈç:
<?php
header('WWW-Authenticate: Negotiate');
header('WWW-Authenticate: NTLM', false);
?>
µÚ¶þ¸ö¿ÉÑ¡²ÎÊý http_response_code Ç¿Öƽ« HTTP ÏìÓ¦´úÂëÉèΪָ¶¨Öµ£¨´Ë²ÎÊýÊÇ PHP 4.3.0 мӵģ©¡£
ÓÐÁ½ÖÖÌØÊâµÄ header µ÷ÓᣵÚÒ»ÖÖÊDZêÍ·ÒÔ×Ö·û´®“HTTP/”£¨´óСд²»ÖØÒª£©¿ªÍ·µÄ£¬¿ÉÒÔÓÃÀ´È·¶¨Òª·¢Ë굀 HTTP ״̬Âë¡£ÀýÈ磬Èç¹ûÅäÖÃÁË Apache Óà PHP À´´¦ÀíÕÒ²»µ½ÎļþµÄ´íÎó´¦ÀíÇëÇó£¨Ê¹Óà ErrorDocument Ö¸Á£¬ÐèҪȷ±£½Å±¾²úÉúÁËÕýÈ·µÄ״̬Âë¡£
<?php
header("HTTP/1.0 404 Not Found")
?>
×¢: HTTP ״̬Âë±êÍ·ÐÐ×ÜÊǵÚÒ»¸ö±»·¢Ë͵½¿Í»§¶Ë£¬¶ø²¢²»¹Üʵ¼ÊµÄ header() µ÷ÓÃÊÇ·ñÊǵÚÒ»¸ö¡£³ý·Ç HTTP ±êÍ·ÒѾ­·¢ËͳöÈ¥£¬ÈκÎʱºò¶¼¿ÉÒÔͨ¹ýÓÃеÄ״̬Ðе÷Óà header() º¯ÊýÀ´¸²¸ÇÔ­Ïȵġ£
µÚ¶þÖÖÌØÊâÇé¿öÊÇÒÔ“Location:”±êÍ·¡£Ëü²»Ö»ÊÇ°ÑÕâ¸ö±êÍ··¢ËÍ»Øä¯ÀÀÆ÷£¬Ëü»¹½«Ò»¸ö REDIRECT£¨302£©×´Ì¬Âë·µ»Ø¸øä¯ÀÀÆ÷£¬³ý·Ç֮ǰÒѾ­·¢³öÁËij¸ö 3xx ״̬Âë¡£
<?php
header("Location: http://www.example.com/"); /* Öض¨Ïòä¯ÀÀÆ÷ */
/* È·±£Öض¨Ïòºó£¬ºóÐø´úÂë²»»á±»Ö´ÐÐ */
exit;
?>
×¢: HTTP/1.1 ±ê×¼ÐèÒªÒ»¸ö¾ø¶ÔµØÖ·µÄ URI ×öΪ Location: µÄ²ÎÊý, µ«ÓÐһЩ¿Í»§¶ËÖ§³ÖÏà¶Ô URI¡£Í¨³£¿ÉÒÔʹÓà $_SERVER['HTTP_HOST']¡¢$_SERVER['PHP_SELF'] ¼° dirname() º¯ÊýÀ´×Ô¼º´ÓÏà¶Ô URI ²úÉú³ö¾ø¶Ô URI£º
<?php
header("Location: http://".$_SERVER['HTTP_HOST']
                        . rtrim(dirname($_SERVER['PHP_SELF']), '/\\')
                       ."/".$relative_url);
?>
×¢: ¼´Ê¹ÆôÓÃÁË session.use_trans_sid£¬Sess


Ïà¹ØÎĵµ£º

PHP½Ì³Ì£ºAJAX Ó¦ÓÃWEB¿ª·¢

AJAXÎÞÒÉÊÇ2005Äê³´µÄ×îÈȵÄWeb¿ª·¢¼¼ÊõÖ®Ò»£¬µ±È»£¬Õâ¸ö¹¦ÀÍÀë²»¿ªGoogle¡£ÎÒÖ»ÊÇÒ»¸öÆÕͨ¿ª·¢Õߣ¬Ê¹ÓÃAJAXµÄµØ·½²»ÊÇÌرð¶à£¬ÎҾͼòµ¥µÄ°ÑÎÒʹÓõÄÐĵÃ˵һÏ¡££¨±¾ÎļÙÉèÓû§ÒѾ­¾ßÓÐJavaScript¡¢HTML¡¢CSSµÈ»ù±¾µÄWeb¿ª·¢ÄÜÁ¦£©
¡¡¡¡[AJAX½éÉÜ]
¡¡¡¡AjaxÊÇʹÓÿͻ§¶Ë½Å±¾ÓëWeb·þÎñÆ÷½»»»Êý¾ÝµÄWebÓ¦Óÿª·¢·½·¨¡£WebÒ³ ......

PHPÒ³Ãæ±àÂëͳһ

MySQLÊý¾Ý¿â±àÂë¡¢htmlÒ³Ãæ±àÂë¡¢PHP»òhtmlÎļþ±¾Éí±àÂëҪȫ²¿Ò»Ö¡£
1¡¢MySQLÊý¾Ý¿â±àÂ룺½¨Á¢Êý¾Ý¿âʱָ¶¨±àÂ루Èçgbk_chinese_ci)£¬½¨Á¢Êý¾Ý±í¡¢½¨Á¢×ֶΡ¢²åÈëÊý¾Ýʱ²»ÒªÖ¸¶¨±àÂ룬»á×Ô¶¯¼Ì³ÐÊý¾Ý¿âµÄ±àÂë¡£
Êý¾Ý¿âÁ¬½Óʱ£¬Ò²ÓбàÂ룬¿ÉÒÔÔÚÁ¬½ÓÍêÊý¾Ý¿âºó£¬Ö´ÐÐ
mysql_query(‘SET NAMES gbk’);//½«gbk» ......

PHP·ÃÎÊMySQLÊý¾Ý¿âº¯Êý¼ò½é


      PHP·ÃÎÊMySQLÊý¾Ý¿âº¯Êý¼ò½é
1. ½øÐÐÊý¾Ý¿âÁ¬½Ó
    Á¬½ÓÊý¾Ý¿â·þÎñÆ÷£¬¾ÍÊÇ¿Í»§¶ËÏò¼ºÔËÐеÄÊý¾Ý¿â·þÎñÆ÷·¢³öÁ¬½ÓÇëÇó£¬
    ³É¹¦ÒÔºó¾Í¿ÉÒÔ¶ÔÊý¾Ý¿â½øÐÐÏàÓ¦²Ù×÷£¬ÓÉÓÚÓû§µÄȨÏÞ²»Í¬£¬ËùÄܽø
    ÐеIJÙ×÷Ò²²»Ò»Ñù¡£PHPÌṩÁËһϵÁÐMySQL ......

PHPÖÐpregº¯ÊýģʽÐÞÕý·û

i ×î³£¼ûµÄ,´óСдºöÂÔģʽ. m (PCRE_MULTILINE) ¶àÐÐģʽ.ĬÈÏÇé¿öÏÂ,PCRE½«Ä¿±ê×Ö·û´®×÷Ϊµ¥Ò»µÄÒ»"ÐÐ"×Ö·ûËù×é³ÉµÄ£¨ÉõÖÁÆäÖаüº¬Óл»ÐзûÒ²ÊÇÈç´Ë)."ÐÐÆðʼ"Ôª×Ö·û£¨^£©½ö½öÆ¥Åä×Ö·û´®µÄÆðʼ,"ÐнáÊø"Ôª×Ö·û£¨$£©½ö½öÆ¥Åä×Ö·û´®µÄ½áÊø£¬»òÕß×îºóÒ»¸ö×Ö·ûÊÇ»»ÐзûʱÆäÇ°Ã棨³ý·ÇÉ趨ÁË D ÐÞÕý·û£©.ÕâºÍ Perl ÊÇÒ»ÑùµÄ.µ ......

PHP5ÔÚLinuxÏ°²×°


LinuxÏ°²×°PHP5µÄÖ÷Òª²½Öè:
1.ÏÂÔØphp5£»µØÖ·£ºhttp://cn.php.net/downloads.php
2.½âѹÈí¼þ°üºó½øÈë¸ÃĿ¼
£¨×ªÕß×¢£º
¿ÉÄÜ»áÐèÒªÏȽâѹphp-5.*.tar.bz2 ,ÏÈÖ´ÐÐbzip2 -d php-5.*tar.bz2
£©
tar -xvf php-5.*.tar.gz
cd php-5.*
3.php°²×°mysqlµÄÄ£¿éµÄһЩ׼±¸¹¤×÷
ln -s /usr/local/mysql/lib/mysql /usr/l ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ