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

PHP header() examples ÍêÕû´úÂë


/*** Function: PHP header() examples (PHP)
**
Desc: Some examples on how to use the header() function of PHPYou find
a detailed tutorial at expertsrt.com (English) or at ffm.junetz.de
(German).These is also a good help about caching at web-caching.com.
**
Example: see below.
<br/><br/><b>Tip:</b>
You can use these sites to check your headers: <a
href="http://web-sniffer.net/">web-sniffer.net</a>,
<a
href="http://www.delorie.com/web/headers.html">delorie.com</a>
or <a
href="http://www.forret.com/projects/analyze/">www.forret.com</a>.
** Author: Jonas John
*/
// fix 404 pages:
header('HTTP/1.1 200 OK');
// set 404 header:
header('HTTP/1.1 404 Not Found');
// set Moved Permanently header (good for redrictions)
// use with location header
header('HTTP/1.1 301 Moved Permanently');
// redirect to a new location:
header('Location: http://www.example.org/');
// redrict with delay:
header('Refresh: 10; url=http://www.example.org/');
print 'You will be redirected in 10 seconds';
// you could also use the HTML syntax:// <meta http-equiv="refresh" content="10;http://www.example.org/ />
// override X-Powered-By: PHP:
header('X-Powered-By: PHP/4.4.0');
header('X-Powered-By: Brain/0.6b');
// content language (en = English)
header('Content-language: en');
// last modified (good for caching)
$time = time() – 60; // or filemtime($fn), etc
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT');
// header for telling the browser that the content
// did not get changed
header('HTTP/1.1 304 Not Modified');
// set content length (good for caching):
header('Content-Length: 1234');
// Headers for an download:
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="example.zip"');


Ïà¹ØÎĵµ£º

7ÖÖÁ÷ÐÐPHP¼¯³É¿ª·¢¹¤¾ß(IDE)µÄ±È½Ï

ʲôÊÇ IDE?
¡¡¡¡¼ò¶øÑÔÖ®£¬IDE Ϊ±àÂ빤×÷ÌṩÁËһվʽ·þÎñ¡£IDE °üÀ¨Ò»¸ö±à¼­Æ÷£¬Ôڴ˱༭Æ÷ÄÚ¿ÉÒԱ༭´úÂë¡¢µ÷ÊÔ´úÂë¡¢ÔÚä¯ÀÀÆ÷(ͨ³£ÊÇǶÈëʽµÄ)Öв鿴´úÂëºÍÇ©ÈëºÍÇ©³öÔ´Âë¿ØÖÆ¡£ÎªÁËÖ§³ÖÕâЩ¹¦ÄÜ£¬IDE ÓµÓÐÒ»Ì×ÔÚ»ù±¾±à¼­Æ÷(±ÈÈç¼Çʱ¾»òÕß Vim)ÖÐËùÕÒ²»µ½µÄÌØÐÔ¡£µ±È»£¬Äú¿ÉÒÔͨ¹ýÀ©Õ¹±à¼­Æ÷À´ÊµÏÖÕâЩ¹¦ÄÜ£¬µ«ÊÇ ID ......

ÔÚPHPÖÐÈ«Ãæ×èÖ¹SQL×¢Èëʽ¹¥»÷Ö®Ò»

Ò»¡¢ ÒýÑÔ
¡¡¡¡PHPÊÇÒ»ÖÖÁ¦Á¿Ç¿´óµ«Ï൱ÈÝÒ×ѧϰµÄ·þÎñÆ÷¶Ë½Å±¾ÓïÑÔ£¬¼´Ê¹ÊǾ­Ñé²»¶àµÄ³ÌÐòÔ±Ò²Äܹ»Ê¹ÓÃËüÀ´´´½¨¸´ÔӵĶ¯Ì¬µÄwebÕ¾µã¡£È»¶ø£¬ËüÔÚʵÏÖÒòÌØÍø·þÎñµÄÃØÃܺͰ²È«·½ÃæÈ´³£³£´æÔÚÐí¶àÀ§ÄÑ¡£ÔÚ±¾ÏµÁÐÎÄÕÂÖУ¬ÎÒÃǽ«Ïò¶ÁÕß½éÉܽøÐÐweb¿ª·¢Ëù±ØÐèµÄ°²È«±³¾°ÒÔ¼°PHPÌØ¶¨µÄ֪ʶºÍ´úÂë-Äã¿ÉÒÔ½èÒÔ±£»¤Äã×Ô¼ºµÄwebÓ¦Óó ......

ÔÚPHPÖÐÈ«Ãæ×èÖ¹SQL×¢Èëʽ¹¥»÷Ö®Èý

Ò»¡¢ ½¨Á¢Ò»¸ö°²È«³éÏó²ã
¡¡¡¡ÎÒÃDz¢²»½¨ÒéÄãÊÖ¹¤µØ°ÑÇ°Ãæ½éÉܵļ¼ÊõÓ¦ÓÃÓÚÿһ¸öÓû§ÊäÈëµÄʵÀýÖУ¬¶øÊÇÇ¿ÁÒÍÆ¼öÄãΪ´Ë´´½¨Ò»¸ö³éÏó²ã¡£Ò»¸ö¼òµ¥µÄ³éÏóÊǰÑÄãµÄУÑé·½°¸¼ÓÈëµ½Ò»¸öº¯ÊýÖУ¬²¢ÇÒÕë¶ÔÓû§ÊäÈëµÄÿһÏîµ÷ÓÃÕâ¸öº¯Êý¡£µ±È»£¬ÎÒÃÇ»¹¿ÉÒÔ´´½¨Ò»ÖÖ¸ü¸´Ôӵĸü¸ßÒ»¼¶µÄ³éÏó-°ÑÒ»¸ö°²È«µÄ²éѯ·â×°µ½Ò»¸öÀàÖУ¬´Ó¶øÓ¦ ......

PHP Éú³ÉËæ»úÊý

function randomkeys($length)
{
 $key='';
 $pattern='123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
 for($i=0;$i<$length;$i++)
 {
   $key .= $pattern{mt_rand(0,47)}; 
       
  }
   ......

ÍêÕûlinuxÏÂphpµ¥·þÎñÆ÷ÅäÖÃ

²Ù×÷ϵͳCentOS 5.3
ϵͳ°²×°Íê³Éºó£¬°²×°±ØÒªµÄ°ü
yum install autoconf gcc gcc-c++ libjpeg libjpeg-level
libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ