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

Ïêϸ½âÊÍPHPÖÐheaderºÍcontent


void header ( string string [, bool replace [, int http_response_code]] )
void header ( string string [, bool replace [, int http_response_code]] )
header()ÊÇÓÃÀ´·¢ËÍ HTTP HeaderµÄ¡£replaceÊǸö¿ÉÑ¡µÄ²ÎÊý£¬Ö¸Ê¾ÊÇ·ñÌæ´úÒ»¸öÏÈÆÚÏàËƵÄheader£¬
»òÕßÔö¼ÓµÚ2¸öÏàͬÀàÐ͵Äheader¡£Ä¬ÈϵÄÊÇÌæ´ú£¬µ«ÊÇÈç¹ûÄã´«µÝFALSE²ÎÊý¸øµÚ2¸ö²ÎÊý(¼´replace),Äã
ÄÜÇ¿ÖÆʹÓöà¸öÏàͬÀàÐ͵Äheader¡£ÀýÈ磺

<?php
header(’WWW-Authenticate: Negotiate’);
header(’WWW-Authenticate: NTLM’, false);
?>
µÚ¶þ¸ö¿ÉÑ¡µÄ²ÎÊýhttp_response_codeÇ¿ÖÃHTTPÏìÓ¦´úÂëµÄÖµ¡£(PHP>4.3.0)
ÓÐÁ½ÖÖÌض¨µÄheaderµ÷Óá£Ò»ÖÖÊÇheaderÓÃ×Ö·û´®”HTTP/”¿ªÍ·µÄ(´óСдÎÞËùν),ËüÓÃ
À´Ö¸¶¨·¢³öµÄHTTP״̬Âë¡£¾Ù¸öÀý×ÓÀ´Ëµ£¬Èç¹ûÄãÒѾ­ÅäÖÃApacheʹÓÃPHP½Å±¾À´´¦ÀíÇëÇó
²»´æÔÚµÄÎļþ(ÓÃErrorDocumentÖ¸Áî)£¬Äã¿ÉÄÜÏëÈ·ÈÏÄãµÄ½Å±¾Éú³ÉÒ»¸öºÏÊʵÄ״̬Â룺

<?php
header(”HTTP/1.0 404 Not Found”);
?>
×¢Ò⣺HTTP״̬ÐÐ ×ÜÊÇ×îÏÈ·¢Ë͸ø¿Í»§¶ËµÄ£¬²»¹ÜÄãʵ¼ÊÉÏÔÚʲôʱºòµ÷ÓÃheader()º¯Êý¡£
³ý·ÇÄãµÄHTTP headerÒѾ­·¢ËͳöÈ¥ÁË£¬·ñÔò£¬ÔÚÈκÎʱºò£¬×´Ì¬½«»á±»header()º¯ÊýÓÃÒ»¸öеÄ
״̬ÐÐ ¸²¸Ç¡£
ÔÚPHP 3ÖУ¬Ö»ÓÐPHP±àÒëΪApacheµÄÄ£¿éÊÇ£¬²¢ÇÒÓÃÏÂÃæStaus Header²ÅÄÜÈ¡µÃͬÑùµÄЧ¹û

<?php
header(”Status: 404 Not Found”);
?>
µÚ¶þÖÐÌØÊâµÄÇé¿ö¾ÍÊÇ”Location:”header¡£Èç¹ûûÓÐijЩ 3xxµÄ״̬ÂëÒѾ­·¢³öµÄ»°£¬Ëü²»½ö
·¢³öLocationÐУ¬¶øÇÒ·¢³öÒ»¸öÖض¨ÏòµÄ״̬Âë(302)¡£

<?php
header(”Location: http://www.upsdn.net”);
exit;
?>
×¢Òâ:HTTP/1.1ÒªÇóÒ»¸ö¾ø¶ÔURI×÷ΪLocationµÄ²ÎÊý£º°üÀ¨Ð­ÒéÍ·£¬Ö÷»úÃûºÍ¾ø¶Ô·¾¶£¬
µ«ÊÇijЩ¿Í»§¶Ë¿ÉÒÔ½ÓÊÜÏà¶ÔURI¡£Äã¿ÉÓÃ$_SERVER['HTTP_HOST'] $_SERVER['PHP_SELF']ºÍ
dirname()À´´ÓÒ»¸öÏà¶ÔURIÀ´²úÉú¾ø¶ÔURI¡£


Ïà¹ØÎĵµ£º

ÈçºÎ±àдPHPÀ©Õ¹

 ¼ò ½é
PHPÈ¡µÃ³É¹¦µÄÒ»¸öÖ÷ÒªÔ­ÒòÖ®Ò»ÊÇËýÓµÓдóÁ¿µÄ¿ÉÓÃÀ©Õ¹¡£web¿ª·¢ÕßÎÞÂÛÓкÎÖÖÐèÇó£¬ÕâÖÖÐèÇó×îÓпÉÄÜÔÚPHP·¢ÐаüÀïÕÒµ½¡£PHP·¢Ðаü°üÀ¨Ö§³Ö¸÷ÖÖÊý¾Ý¿â£¬Í¼ÐÎÎļþ¸ñʽ£¬Ñ¹Ëõ£¬XML¼¼ÊõÀ©Õ¹ÔÚÄÚµÄÐí¶àÀ©Õ¹¡£
À©Õ¹APIµÄÒýÈëʹPHP3È¡µÃÁ˾޴óµÄ½øÕ¹£¬À©Õ¹API»úÖÆʹPHP¿ª·¢ÉçÇøºÜÈÝÒ׵Ŀª·¢³ö¼¸Ê®ÖÖÀ©Õ¹¡£ÏÖÔÚ£¬Á½¸ ......

PHP±àÂë¹æ·¶

 
×¢£ºÕâÊÇ´ÓPHPCMS¿ª·¢ÎĵµÀï¿´µ½±àÂë¹æ·¶£¬ËäÃûΪPHPCMSµÄ¿ª·¢¹æ·¶£¬µ«ÎÒ¾õµÃËùÓеÄPHP±à³Ì¶¼¸ÃÈç´Ë¡£Ð´ÁËÄÇô¶àPHP£¬ºÜ¶à±àÂë¶ÔÕÕÕâ¹æ·¶¶¼¸Ð¾õǷȱºÜ¶à£¬½ñºóÒ»¶¨Òª¶ÔÕÕ¾ÀÕý¡£
Phpcms ±àÂë¹æ·¶
1. ÒýÑÔ…. 2
2. ÊÊÓ÷¶Î§…. 2
3. ±ê×¼»¯µÄÖØÒªÐԺͺô¦…. 3
4. PHP±àÂë¹æ·¶ÓëÔ­Ôò…. ......

JQuery´òÔìPHPµÄAJAX±íµ¥ÌύʵÀý

±¾ÊµÀýÖ»ÀûÓõ½JQueryÀà¿â±¾ÉíµÄº¯ÊýºÍ¹¦ÄÜ£¬²»ÐèÒªµÚÈý·½²å¼þµÄÖ§³Ö¡£ÁíÍ⣬ËùÓÐ±íµ¥ÐÅÏ¢¶¼ÊÇÀûÓÃPHPMailerÀà¿âÓʼþµÄÐÎʽ·¢Ë͸ø¹ÜÀíÔ±¡£Èç¹ûÄã¶ÔJQueryµÄ»ù±¾Óï·¨»¹²»ÊǺÜÊìϤ£¬ÇëËÑË÷±¾Õ¾µÄ½Ì³Ì×ÊÔ´¡£Èç¹ûÄã¶ÔPHPMailerÓ÷¨²»ÊìϤ£¬Çë²é¿´±¾Õ¾µÄÁíһƪÎÄÕ¡¶Ê¹ÓÃPHPMailerÀà¿â·¢Ë͵ç×ÓÓʼþ¡·¡£
µÚÒ»²½£¬´´½¨Ò»¸ö±íµ¥HTM ......

09Äê5ÔÂ11ºÅ×îÐÂPHPÃæÊÔÌâ

һѡÔñÌ⣺
1.ÏÂÃæµÄÄǸöÑ¡Ïî¿ÉÒÔ»ñÈ¡±íµ¥Ìá½»µÄÖµ£¿£¨¶àÑ¡£© b d
<form name='frm1' method="post">
<input type="text" name="name" ><input type="submit" name="a">
</form>
A.$_GET['name']
B.$_POST['name']
C.$_SESSION['name']
D.$_REQUEST['name']
E.$_GLOBAL['name']
2.ÍüÀ²¡£ ......

php·ÀÖ¹Ò³ÃæˢдúÂë

 ¿ÉÓÃÓÚphpµÄ¼ÆÊýÆ÷ºÍ±íµ¥µÄÌá½»£¬·ÀÖ¹·´¸´Ë¢Ð¡£
¸´ÖÆ´úÂë
<?php
session_start();
$allow_sep = "30000";
if (isset($_SESSION["post_sep"]))
{
if (time() - $_SESSION["post_sep"] < $allow_sep)
{
exit("Çë²»Òª·´¸´Ë¢ÐÂ");
}
else
{
$_SESSION["post_sep"] = time();
}
}
e ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ