phpʵÏÖÌæ»»UTF
ÅúÁ¿È¥³ýBOMµÄ³ÌÐò
function
replace_utf8bom(
$str
)
{
$charset
[1] =
substr
(
$str
,0,1);
$charset
[2] =
substr
(
$str
,1,1);
$charset
[3] =
substr
(
$str
,2,1);
if
(ord(
$charset
[1]) == 239 && ord(
$charset
[2]) == 187 && ord(
$charset
[3]) == 191)
{
return
substr
(
$str
,3);
}
else
{
return
false;
}
}
ºÜÃ÷ÏÔ£¬Õâ¾ÍÊÇÇ°ÃæÈý¸ö×Ö·ûÊǹ̶¨µÄÔÒò£¬µ±È»¿ÉÒÔÕâÑùÅжÏÁË¡£¡£¡£Ëµ°×Á˺ܼòµ¥£¬µ«Èç¹û²»ÖªµÀ¾ÍÕæµÄºÜÍ´¿àÁË¡£Ë³±ã˵һÏ£¬ËüÀ´×Ô£ºhttp://www.phptext.net/technology.php?vid=53
Ïà¹ØÎĵµ£º
PHP Security for Deployers
If you're a Developer
READ THIS and then work with your SysAdmins to step through any and all the layers of security designed to protect your apps.
Example:
Traffic must first pass through a SPI firewall (ensure that ONLY necessary ports/protocols are permitted; en ......
ÎÒ·¢ÏֺܶàµÄPHP³ÌÐòÔ±£¬ÓÈÆäÊÇѧϰ»¹²»ÊǺܾõ쬶¼²»ÖªµÀPHPµÄ¾«»ªËùÔÚ¡£Perlµ±ÄêÈçºÎÔÚÉ̽ç³öÃû£¿ÆäÇ¿´óµÄÕýÔò±í´ïʽ¡£¶øPHPÄØ£¿ËûÊÇÒ»ÃÅ´ÓUnixÏ·¢Õ¹ÆðÀ´µÄÓïÑÔ£¬µ±È»Ò²¾Í¼Ì³ÐÁËPerlµÄºÜ¶àÌØµã£¬Í¬Ê±CµÄÓŵ㶼ÓС£¿ìËÙ¡¢¼ò½à¡¢Ã÷ÁË£¬ÓÈÆäÊÇC³ÌÐòÔ±£¬PHPÊÇÖÁ°®£¬ÎÒ¾ÍÊÇÉî°®×Å“PHP”£¨¶¼ÍüÁËÅ®ÓÑÁË:)£©¡ ......
<?
$_mysqlhost="localhost";
$_mysqluser="root";
$_mysqlpass="";
$_mysqldata="mydata";
$_connect=mysql_connect($_mysqlhost,$_mysqluser,$_mysqlpass) or die ("´íÎó".mysql_error());
mysql_query("SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary", $ ......
¼ÙÈçÓÐÁ½¸ö±í£º user ºÍ articles ±í
½á¹¹£º
user£º £¨id, name£©
articles: (id,user_id,title,content)
ÆäÖÐuser.id ºÍ user_id ¹ØÁª
ÔÚuserµÄ modelÖÐµÄ relations·½·¨ÀïÃæ¼Ó£º
return array('articles'=>array(self::HAS_MANY,'articles','user_id'));
ÔÚarticlesµÄ modelÖÐµÄ relations·½·¨ÀïÃæ¼Ó£º
......
ÔÚwindows²Ù×÷ϵͳÅäÖÃPHP»·¾³£¬¿ÉÒÔÓÃIIS×öÓ¦Ó÷þÎñÆ÷£¬Ò²¿ÉÒÔʹÓÃApache×öÓ¦Ó÷þÎñÆ÷¡£±¾ÎĽéÉÜÔÚWindows XP²Ù×÷ϵͳÏÂÅäÖÃPHPºÍApache»·¾³¡£
×¼±¸¹¤×÷£º
1¡¢ÔÚhttp://windows.php.net/download/ÏÂÔØPHP³ÌÐò°ü£¬ÒòΪÓÃApache×öÓ¦Ó÷þÎñÆ÷£¬Ñ¡ÔñÓÃVC6±àÒëµÄ ......