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
Ïà¹ØÎĵµ£º
×¢£ºÕâÊÇ´ÓPHPCMS¿ª·¢ÎĵµÀï¿´µ½±àÂë¹æ·¶£¬ËäÃûΪPHPCMSµÄ¿ª·¢¹æ·¶£¬µ«ÎÒ¾õµÃËùÓеÄPHP±à³Ì¶¼¸ÃÈç´Ë¡£Ð´ÁËÄÇô¶àPHP£¬ºÜ¶à±àÂë¶ÔÕÕÕâ¹æ·¶¶¼¸Ð¾õǷȱºÜ¶à£¬½ñºóÒ»¶¨Òª¶ÔÕÕ¾ÀÕý¡£
Phpcms ±àÂë¹æ·¶
1. ÒýÑÔ…. 2
2. ÊÊÓ÷¶Î§…. 2
3. ±ê×¼»¯µÄÖØÒªÐԺͺô¦…. 3
4. PHP±àÂë¹æ·¶ÓëÔÔò…. 3
4. ......
1¡¢µ½Î¢Èí¹Ù·½È¥ÏÂÔØеÄÇý¶¯£¬ÏÂÔصØÖ·ÈçÏ£º
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9
¡¡¡¡¹Ù·½ÎĵµÓÐÃèÊö£º
¡¡¡¡Refer to the documentation that is installed with the driver for a description of the new features in this ......
Àý£º
ÒªÇóÆ¥Åä±êÌâ
<div class="detail-hd">
<h3>
Îå»Ê¹Ú 2010´º×°ÐÂƷʱÉÐTÐô ³¤Ðä Å®×°³¤¿îTÐô ÈÈÂôº«°æ³¤T ÌؼÛ
</h3>
$reg="|<div class=\"detail-hd\">[\n\r\t]*<h3>[\n\r\t]*(.*)[\n\r\t]*</h3>|";
pre ......
µÚÒ»²½£ºÏÂÔØ°²×°³ÌÐò
£¨1£© Apache2.2.4°æÏÂÔØ£¬µØÖ·£ºhttp://httpd.apache.org/download£¬Ñ¡Ôñ
apache_2.2.4-win32-x86-no_ssl.msi£¬´óÔ¼4M¶à¡£
£¨2£©PHP5.2.3°æÏÂÔØ£¬ µØÖ·£ºhttp://www.php.net/downloads.php£¬Ñ¡ÔñWindows BinariesÏÂÃæµÄPHP5.2.3.zip package£¬Ëü¶ÔÓ¦php-5.2.3-Win32.zipÎļþ£¬´óÔ¼9M¶à¡£
µÚ¶þ² ......
i ×î³£¼ûµÄ,´óСдºöÂÔģʽ. m (PCRE_MULTILINE) ¶àÐÐģʽ.ĬÈÏÇé¿öÏÂ,PCRE½«Ä¿±ê×Ö·û´®×÷Ϊµ¥Ò»µÄÒ»"ÐÐ"×Ö·ûËù×é³ÉµÄ£¨ÉõÖÁÆäÖаüº¬Óл»ÐзûÒ²ÊÇÈç´Ë)."ÐÐÆðʼ"Ôª×Ö·û£¨^£©½ö½öÆ¥Åä×Ö·û´®µÄÆðʼ,"ÐнáÊø"Ôª×Ö·û£¨$£©½ö½öÆ¥Åä×Ö·û´®µÄ½áÊø£¬»òÕß×îºóÒ»¸ö×Ö·ûÊÇ»»ÐзûʱÆäÇ°Ã棨³ý·ÇÉ趨ÁË D ÐÞÕý·û£©.ÕâºÍ Perl ÊÇÒ»ÑùµÄ.µ ......