uchome¶þ´Î¿ª·¢ php³ÌÐò½²½â£¨common.phpÎļþ½âÎö£©
index.phpÎļþµÚÒ»ÐоÍÊÇ°üº¬ÁË
include_once('./common.php');
ÎļþËùÒÔÏȶÔcommon.phpÎļþ½âÎö
<?php
/*
[UCenter Home] (C) 2007-2008 Comsenz Inc.
$Id: common.php 10981 2009-01-14 03:05:20Z liguode $
*/
//¶¨ÒåÒ»¸ö³£Á¿£¬ÓÃÀ´ÔÚÆäËûÒ³ÃæÖУ¬·ÀÖ¹±»¶ñÒâÓû§Ö±½Óµ÷ÓÃÆäËûPHPÎļþ¡£
@define('IN_UCHOME', TRUE);
//¶¨ÒåÒ»¸ö³£Á¿£¬Õâ¸ö³£Á¿±íʾ°æ±¾ºÅ
define('X_VER', '1.5');
//Õâ¸öÒ²ÊÇÒ»¸ö³£Á¿£¬´Î°æ±¾ºÅ
define('X_RELEASE', '20090114');
/*¶¨Òå³ÌÐòµÄµ÷ÊÔģʽ£¬ÔÚÎÒÃǵ÷ÊÔ³ÌÐòµÄʱºò½«³£Á¿ÖµÉèΪ1£¬ÕâÑù³ÌÐò³ö´íµÄʱºò»áÔÚÒ³ÃæÏÔʾ´íÎóÐÅÏ¢¡£
ÔÚµ÷ÊÔÍê±ÏÕý³£Í¶ÈëʹÓúóÉèΪ0£¬ÕâÑù³ÌÐò³ö´í²»»áÏÔʾ¸øÓû§¡£
*/
define('D_BUG', '0');
//ͨ¹ýD_BUG³£Á¿ÖµÖ¸¶¨´íÎ󱨸æÀàÐÍ¡£ÆäÖÐerror_reporting()µÄ²ÎÊýÊÇ´íÎ󱨸æÀàÐÍ£¬Ïà¹Ø²ÎÊý¿É²éѯPHPÊÖ²á
D_BUG?error_reporting(7):error_reporting(0);
//ÕâÏÂÃ涼ÊǶ¨ÒåµÄÈ«¾Ö±äÁ¿¡£¾ßÌåµÄ»áÔÚºóÃæʹÓõÄʱºòÒ»Ò»½éÉÜ
$_SGLOBAL = $_SCONFIG = $_SBLOCK = $_TPL = $_SCOOKIE = $_SN = $space = array();
/*
$_SGLOBAL = ³¬È«¾Ö¹«¹²ÐÅÏ¢
$_SCONFIG = ³ÌÐòÅäÖÃÐÅÏ¢
$_SBLOCK = Ó¦ÓÿéÐÅÏ¢
$_TPL = Ä£°åÐÅÏ¢
$_SCOOKIE = cookieÐÅÏ¢
$_SN = UCenter¹ØÁ¬ÐÅÏ¢
$space = Óû§ÐÅÏ¢
$_SGLOBAL['msglang'] = ÌáʾÐÅÏ¢µÄÓïÑÔÐÅÏ¢,ÆäËüÒ³µÄÓïÑÔ»ù±¾ÉÏÈ«²¿Ð´ÔÚÄ£°åÉÏ;
*/
//¶¨Òå³ÌÐòĿ¼³£Á¿¡£ÆäÖÐDIRECTORY_SEPARATORÊÇ·¾¶·Ö¸ô·û£¬linuxÉϾÍÊÇ’/’ windowsÉÏÊÇ’\’
define('S_ROOT', dirname(__FILE__).DIRECTORY_SEPARATOR);
//¼ÓÔØ»ù±¾µÄÅäÖÃÎļþ£¬ÓÃÁË@·ûºÅ£¬´ïµ½ÕÒ²»µ½¸ÃÎļþʱÔÚÒ³Ãæ²»Ìáʾ´íÎóÐÅÏ¢
if(!@include_once(S_ROOT.'./config.php')) {
//Èç¹ûÕÒ²»µ½µÄ»°ÔòÖض¨Ïòµ½°²×°Îļþ
header("Location: install/index.php");
exit();
}
//ͨÓú¯ÊýÎļþ£¬¾ßÌ庯ÊýÔÚ½éÉÜʱ¼ä»áÒ»Ò»½âÊÍ
include_once(S_ROOT.'./source/function_common.php');
//ʱ¼ämicrotime()»ñÈ¡º¬ºÁÃëµÄʱ¼ä
$mtime = explode(' ', microtime());
$_SGLOBAL['timestamp'] = $mtime[1];
//$mtime[0]ΪUNIXʱ¼ä´Á£¨ÕûÐΣ©£¬ $mtime[0]ΪºÁÃë
$_SGLOBAL['supe_starttime'] = $_SGLOBAL['timestamp'] + $mtime[0];
//get_magic_quotes_gpc¼ì²âPHP.INIÅä
Ïà¹ØÎĵµ£º
¡¾×ª¡¿http://www.linuxsir.org/main/?q=node/241
1.°²×°»·¾³
²Ù×÷ϵͳ£ºRed Hat Linux Enterprise AS 4.0
Êý¾Ý¿â£ºMySQL 5.0.24
Web·þÎñÆ÷£ºApache 2.2.3
½Å±¾ÓïÑÔ£ºPHP 5.1.6
2.°²×°MySQL 5.0.24
-------------ÏÂÔØÈí¼þ°ümysql-5.0.24.tar.gz£¬µØÖ·http://www.mysql.com-------------
# tar zvxf mysql-5.0.24.ta ......
¹«Ë¾·´Ó¦Äͷɼҽ̺ͼæÖ°ºǫ́ÏÔʾµÄʱ¼ä¸úʵ¼Ê×¢²áµÄʱ¼äÏà²î8Сʱ¡£
·¢ÏÖʱ¼äÒ»Ö±¶Ô²»ÉÏ£¬date("Y-m-d h:i:s") ×ÜÊÇÓë·þÎñÆ÷ʱ¼ä²î8¸öСʱ£®ºóÀ´·¢ÏÖ£¬ÎÒÏÖÔڵĻúÆ÷ÉϵÄphpÊÇ5.14µÄ£®¡¡
ÔÀ´´Óphp5.1.0¿ªÊ¼£¬php.iniÀï¼ÓÈëÁËdate.timezoneÕâ¸öÑ¡ÏĬÈÏÇé¿öÏÂÊǹرյÄ
Ò²¾ÍÊÇÏÔʾµÄʱ¼ä£¨ÎÞÂÛÓÃʲôphpÃüÁ¶¼ÊǸñÁ ......
ÈëÃÅ֪ʶ
Ôڴ˼ٶ¨Äú¶Ô PHP µÄÓï·¨ÓÐÒ»¸ö´óÖµÄÁ˽⣬ÖÁÉÙÄܹ»±àд“Hello World”Ö®ÀàµÄ³ÌÐò¡£Èç¹ûÄú²»¾ß±¸»ù´¡ÖªÊ¶£¬ÔòÇëÊ×ÏÈѧϰ PHP ÊÖ²áºÍijЩ»ù±¾µÄ PHP ½Ì³Ì¡£ºÜ¶à³ö°æÉ̶¼ÓйØÓÚ PHP µÄºÃÊé¡£½¨Òé³õѧÕßÒ»¿ªÊ¼ÏÈ¿´¿´ÈëÃÅÊé¼®»òʳÆ×ÐÎʽµÄÊé¼®¡£
ÔÚÉú²ú»·¾³µÄ׼ȷ¸±±¾ÉÏÖ´ÐÐÉó¼Æ¡£Äú²»ÐèÒª¸´ÖÆÓ²¼þ£¬µ«Ê ......
Ò»¡¢¿ª·¢³ÉÔ±
a)ÏîÄ¿Ö÷¹Ü
b)Ò³ÃæÃÀ¹¤
c)Ò³Ã濪·¢
d)·þÎñ¶Ë³ÌÐò¿ª·¢
e)ϵͳÓëÊý¾Ý¹ÜÀí
f)²âÊÔÓë°æ±¾¿ØÖÆ
¶þ¡¢ ÍøÕ¾×鿪·¢¼òÃ÷Á÷³Ì
Èý¡¢ ¿ª·¢¹¤¾ßÓë»·¾³
a)·þÎñÆ÷ÅäÖÃ
i. WEB·þÎñÆ÷£º FreeBSD6.1+Apache2.0+PHP5.0£¬SVN°æ±¾¿ØÖÆ·þÎñ(½ö²âÊÔ»ú)¡£
ii.Êý¾Ý¿â·þÎñÆ÷£º WIN2003 server+SQL server  ......
1.ʹÓÃip2long() ºÍlong2ip()º¯ÊýÀ´°ÑIPµØַת»¯³ÉÕûÐÍ´æ´¢µ½Êý¾Ý¿âÀï¡£
¡¡¡¡ÕâÖÖ·½·¨°Ñ´æ´¢¿Õ¼ä½µµ½Á˽ӽüËÄ·ÖÖ®Ò»(char(15)µÄ15¸ö×Ö½Ú¶ÔÕûÐεÄ4¸ö×Ö½Ú)£¬¼ÆËãÒ»¸öÌض¨µÄµØÖ·ÊDz»ÊÇÔÚÒ»¸öÇø¶ÎÄÚÒ³¸ü¼òµ¥ÁË£¬¶øÇÒ¼Ó¿ìÁËËÑË÷ºÍÅÅÐòµÄËÙ¶È(ËäÈ»ÓÐʱ½ö½öÊÇ¿ìÁËÒ»µã)¡£
¡¡¡¡2.ÔÚÑéÖ¤EmailµØÖ·µÄʱºòʹÓÃcheckdnsrr() º¯ÊýÑéÖ¤ ......