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 ......
Á¬½Ó£º
$conn=mysql_connect ("localhost:3306", "username", "password");
mysql_select_db("DBname");
¶Á£º
$exec="select * from stu";
$result=mysql_query($exec);
while($rs=mysql_fetch_object($result))
{
echo $rs->id." & ......
<?
include 'conn.php';
$_pagenob=10; //ÿҳ¹æ¶¨µÄÐÅÏ¢ÊýÄ¿
//»ñÈ¡µ±Ç°Ò³
if(isset($_GET["page"]))
{
$_page = intval( $_GET['page'] );
}
else
{
$_page=1;
}
//²éѯÊý¾Ý×ÜÊý
$_query="select count(*) as acount from news";
$_result=mysql_query($_query);
$_row=mysql_fetch_row($_result);
......
¡¡¡¡ËäÈ»PHPÊÇWebÓ¦Óÿª·¢ÖÐ×î¹ã·ºÊ¹ÓõĻ·¾³£¬µ«Ëü»¹ÊÇÒ»¶È±»ÈÏΪÎÞÔµÆóÒµ¼¶¿ª·¢¡£InfoQ×éÖ¯ÁËÒ»¸öÐéÄâ×ù̸С×éÀ´ÌÖÂÛÓïÑÔ/ƽ̨µÄÑݱ估PHPÔÚÆóÒµ»·¾³ÏµÄÊÊÓÃÐÔ¡£
¡¡¡¡Zeev Suraski£¬Zend Technologies¹«Ë¾´´Ê¼ÈË£¬¸Ã¹«Ë¾Ö÷Òª¹Ø×¢PHPµÄ½øÕ¹¡£
¡¡¡¡Rob Nicholson£¬¸ß¼¶¼¼ÊõÑÐÔ±, ÔøÎªIBM±àд¹ý³ÌÐòÉè¼ÆÓïÑÔÔËÐÐʱ¡£
¡¡¡ ......