php includeÎļþºó¶à³öÒ»¿Õ°×ÐÐ
ÓöàÖÖ±à¼Èí¼þÐ޸ĹýµÄphpÍøÕ¾¿ÉÄÜ»áÓöµ½Ò»ºÜ¹ÖÎÊÌ⣺ÓÃincludeÒýÈëµÄfooterºÍheaderÎļþ¶¼ÔÚÉÏÃæ¶à³öÒ»¿Õ°×ÐУ¬Ö±½Ó°Ñ±»ÒýÈëµÄÎļþ·ÅÈëÔòûÎÊÌâ¡£Õâ¸öÎÊÌ⼫ÓпÉÄÜÊDZàÂëÎÊÌâÒýÆðµÄ¡£Èç¹û²ÉÓÃutf-8±àÂëÒªÉèÖÃΪÎÞbom£¬²¢ÇÒÒªËùÓеÄÉæ¼°µ½µÄÒ³Ãæ°üÀ¨css¼°ÆäËûÎļþ¶¼ÒªÒÔÎÞbomµÄutf-8±àÂë¡£¾ßÌå·½·¨¿ÉÒÔÊÇ£ºÔÚDreamweaverÀï µã“Ð޸Ĕ£¬Ñ¡Ôñ“Ò³ÃæÊôÐÔ”£¬“±êÌâ/±àÂ딣¬°Ñ °üÀ¨unicodeÇ©Ãû(bom) µÄ¹´È¡Ïû¡£
Ïà¹ØÎĵµ£º
Í·²¿µ÷ÓÃ
<?
require('conn.php');
$sql1="select id from news";
$query1=mysql_query($sql1,$conn);
$sun_num=mysql_num_rows($query1);
$gs=20;
$page_num=ceil($sun_num/$gs);
include("../subpage.php");
//´«¹ýÀ´µÄÒ³Êý²ÎÊý
$PB_page=$_GET['PB_page'];
if ($PB_page==1 or empty($PB_page)){
$ ......
×÷Õß: laruence(http://www.laruence.com
)
±¾ÎĵØÖ·: http://www.laruence.com/2010/05/04/1450.html
תÔØÇë×¢Ã÷³ö´¦
ÔÚ´óÐ͵ÄWebÏîÄ¿ÖÐ, include_pathÊÇÒ»¸öÄ£¿é»¯Éè¼ÆµÄ¸ù±¾Öеĸù±¾(µ±È»,ÏÖÔÚÒ²Óкܶà»ùÓÚautoloadµÄÉè¼Æ,
Õâ¸ö²»Ó°Ïì±¾ÎĵÄ̽ÌÖ), µ«ÊÇÕýÊÇÒòΪinclude_path, ¾³£»áÈÃÎÒÃÇÓöµ½Ò»Ð©ÒòΪûÓÐÕÒµ½Õ ......
¡¡sessionÊÇÍøÕ¾±£´æÓû§ÐÅÏ¢µÄÒ»ÖÖÊֶΣ¬Ó¦ÓÃÏ൱¹ã·º¡£ÀýÈçµÚÎå½ìÅÅÐаñ¾ÍʹÓÃÁËsession¡£¾¹ý¶ÔµÚÎå½ìÅÅÐаñµÄÐ޸ģ¬ÎÒ×ܽáÁËÒ»ÏÂphpÖÐsessionµÄÓ÷¨¡£
£¨Ò»£©¿ªÊ¼session
¡¡¡¡ÔÚÿһ´ÎʹÓÃsession֮ǰ£¬¶¼Òª¼ÓÉÏÕâÒ»¾ä£º“session_start();”¡£¹ËÃû˼Ò壬Õâ¸öº¯ÊýµÄ×÷ÓþÍÊÇ¿ªÊ¼Ê¹ÓÃsession¡£
£¨¶þ£©×¢ ......
<pre>
PHP´úÂë
<?php
// Àý×Ó1
function test_global() {
global $var1, $var2;
$var2 =& $var1;
}
function test_globals() {
......
1. PHPµÄCOOKIE
cookie ÊÇÒ»ÖÖÔÚÔ¶³Ìä¯ÀÀÆ÷¶Ë´¢´æÊý¾Ý²¢ÒÔ´ËÀ´¸ú×ÙºÍʶ±ðÓû§µÄ»úÖÆ¡£
PHPÔÚhttpÐÒéµÄÍ·ÐÅÏ¢Àï·¢ËÍcookie, Òò´Ë setcookie() º¯Êý±ØÐëÔÚÆäËüÐÅÏ¢±»Êä³öµ½ä¯ÀÀÆ÷Ç°µ÷Óã¬ÕâºÍ¶Ô header() º¯ÊýµÄÏÞÖÆÀàËÆ¡£
1.1 ÉèÖÃcookie:
¿ÉÒÔÓÃ&nbs ......