Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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"');


Ïà¹ØÎĵµ£º

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

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

PHPÏÂÔØCSSÎļþÖеÄͼƬ

×÷Ϊһ¸ö×ÊÉî²¢ÇÒרҵµÄ°ÇƤÈËÔ±£¬ÔÚÎÒ´Ó³õÈý¿ªÊ¼Í¶Èëΰ´óµÄ»¥ÁªÍøÖе½ÏÖÔÚ»ýÀÛÁ˷ḻµÄ°ÇƤ¾­Ñé¡£ÎÒÏàÐÅÿ¸ö×öwebµÄ³ÌÐòÔ±Ò²¶¼»áÓÐÀàËÆµÄ¾­Àú¡£
ÔÚ°ÇÆ¤¹ý³ÌÖУ¬±Ø²»¿ÉÉÙµÄÐèÒªÏÂÔØÑùʽÎļþÖеÄͼƬ¡£Åöµ½±È½ÏÅÓ´óµÄÑùʽÎļþ£¬ÆäÖпÉÄÜ»áÓÐÉϰٸöÐèÒªÏÂÔØµÄͼƬ£¬ÄÇôʹÓÃÏÂÃæÕâ¶ÎС´úÂëÊÇ×îΪºÏ
ÊʵÄÁË¡£
< ?php
/* ......

PHPͨ¹ýDOM²Ù×÷XML

PHP XML²Ù×÷ÀàDOMDocumentÊôÐÔ¼°·½·¨
×¢Òâ´óСдһ¶¨²»ÄÜŪ´í.
ÊôÐÔ:
Attributes ´æ´¢½ÚµãµÄÊôÐÔÁбí(Ö»¶Á)
childNodes ´æ´¢½ÚµãµÄ×Ó½ÚµãÁбí(Ö»¶Á)
dataType ·µ»Ø´Ë½ÚµãµÄÊý¾ÝÀàÐÍ
Definition ÒÔDTD»òXMLģʽ¸ø³öµÄ½ÚµãµÄ¶¨Òå(Ö»¶Á)
Doctype Ö¸¶¨ÎĵµÀàÐͽڵã(Ö»¶Á)
documentElement ·µ»ØÎĵµµÄ¸ùÔªËØ(¿É¶Áд)
fi ......

¼¸ÖÖ³£ÓÃPHPÁ¬½ÓÊý¾Ý¿âµÄ´úÂë

PHPÁ¬½ÓÊý¾Ý¿âÖ®PHPÁ¬½ÓMYSQLÊý¾Ý¿â´úÂë < ?php   
$mysql_server_name='localhost'; 
//¸Ä³É×Ô¼ºµÄmysqlÊý¾Ý¿â·þÎñÆ÷  
$mysql_username='root'; 
//¸Ä³É×Ô¼ºµÄmysqlÊý¾Ý¿âÓû§Ãû  
$mysql_password='12345678'; 
//¸Ä³É×Ô¼ºµÄmysqlÊý¾Ý¿âÃÜÂë &nb ......

¼¼Êõ±¸Íü Ϊphp5ÅäÖÃmysql

ÏÖ´æÎÊÌ⣺
1.ÎÞ·¨¼ÓÔØ mcrypt À©Õ¹£¬Çë¼ì²éÄúµÄ PHP ÅäÖá£
°´ÕÕÍøÉÏ˵µÄ¸Ã×öµÄÃ²ËÆ¶¼×öÁË µ«ÊǵÚÒ»´Î´ò¿ªphpmyadminÖ÷ҳʱ »¹ÊÇÓÐÕâ¸öÌáʾ Ææ¹ÖµÄÊǽøÈ¥Ö®ºó ÀïÃæÃ»ÓÐÕâ¸öÌáʾ È»ºóÍ˳öÍâÃæÒ²Ã»ÁË
2.ÅäÖÃÎļþÏÖÔÚÐèÒªÒ»¸ö¶ÌÓïÃÜÂë¡£
ÍøÉÏÕÒÁË µ«ÊÇÎÊÌ⻹ÊÇû½â¾ö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ