php °²È«
ÈçºÎ²»Ê¹ÓÃprepared statment£¬¶øÊÇÓùýÂ˵ķ½·¨±ÜÃâSQL×¢ÈëÄØ£¿
Ò»°ãÀ´Ëµmysql×Ô´øµÄ¹ýÂ˺¯ÊýÊDZȽϿɿ¿µÄ¡£mysql_real_escape_string()
µ«ÊÇÕâ¸öº¯ÊýÔÚijЩ×Ö·û¼¯ÖÐÓÐÎÊÌ⣬±ÈÈçGBK¡£Èç¹ûÄãÓÃUTF8ÄÇû¹ØÏµ¡£
ÔÚPHPÀïÉèÖÃÊý¾Ý¿âµÄ×Ö·û¼¯²»Ó¦¸ÃÓãºmysql_query("SET NAMES UTF8");
¶øÓ¦¸ÃÓãºmysql_set_charset()
ÕâÑùmysql_real_escape_string()ÔÚ´¦ÀíGBK±àÂëµÄʱºò¾Í²»»á³öÎÊÌâÁË¡£
mysql_real_escape_string() not safe when SET NAMES is used
use mysql_set_charset() instead.
Note: This is the preferred way to change the charset. Using mysql_query() to execute SET NAMES .. is not recommended.
SET NAMES is usually used to switch the encoding from what is default to what the application needs. This is done in a way that mysql_real_escape_string doesn’t know about this. This means if you switch to some multi byte encoding that allows backslash as 2nd 3rd 4th… byte you run into trouble, because mysql_real_escape_string doesn’t escape correctly. UTF-8 is safe…
Safe way to change encoding is mysql_set_charset, but that is only available in new PHP versions
Ïà¹ØÎĵµ£º
<?php
function remove_directory($dir) {
if ($handle = opendir("$dir")) {
while (false !== ($item = readdir($handle))) {
if ($item != "." && $item != "..") {
......
PHPÊÇÒ»ÃÅ¿ª·¢Ëٶȿ죬ÔËÐÐËÙ¶È¿ìµÄÓïÑÔ£¬µ«ÊÇËüÒ²ÓÐÖÂÃüȱµã£¬ÎÞ¶àỊ̈߳¨ËäÈ»ApacheµÄ·þÎñÆ÷ÔÚÁíÒ»Ö̶ֳÈÉÏÃÖ²¹ÁËÕâÖÖȱÏÝ£¬µ«ÊÇÔÚ±àдһЩÐèÒª¸ß²¢·¢²¢ÇÒ¿¼ÂÇЧÂʵijÌÐòÏ£¬Ëü»¹ÊÇÃ÷ÏÔ²»×㣩¡£
µ«ÊÇPHP¿ÉÒÔ´ó´óËõ¶Ì¿ª·¢ÖÜÆÚ£¬Ó뿪·¢³É±¾£¨±ÈÈçPHP¶ÔÓÚ³ÌÐòÒªÇóµÄÃż÷ºÜµÍ£©¡£
×ÜÌåÀ´Ëµ£¬PHPºÜÊʺϿª·¢ÍøÕ¾À´Ó㬶øÔÚ¿ª·¢ ......
<?php
function toFixLen($str,$len){ //¹Ì¶¨³¤¶È×Ö·û´®µÄ½ØÈ¡
if($len>=strlen($str)||!$len) return $str;
$len-=3;
  ......
ÒýÓÃhttp://www.icnote.com/Mysql-php-connector/
ÓÉÓÚ¹«Ë¾µÄ·þÎñÆ÷¿ªÊ¼Ö»ÊÇÓÃÓÚjavaµÄÖ§³Ö£¬×°ÁËapache£¬mysql£¬php£¬µ«ÊÇphpµÄ°²×°Ã»ÓжÔmysql½øÐÐÖ§³Ö£¬½ñÌì¶ÔËû½øÐÐÁËÀ©Õ¹£¬¼Ç¼ÈçÏ¡£
Ê×ÏÈ£¬°²×°mysqlºÍphpµÄÁ¬½ÓÀ©Õ¹£¬ÐèÒªÒÔϰü¡£¿ÉÒÔÔÚhttp://rpmfind.net/
ÕÒµ½£¬¸ù ......
¡¾Ê²Ã´ÊÇMVC£¿¡¿
MVCÊÇÒ»¸ö¿ÉÒÔÈÃÄã°Ñ“Èý¸ö²¿·Ö£¨¼´MVCµÄÈ«³Æ£¬Model¡¢ View¡¢Controller£©”гµ÷µØ×é³ÉÒ»¸ö¸´ÔÓÓ¦ÓóÌÐòµÄ¸ÅÄî¡£Ò»Á¾Æû³µ¾ÍÊÇÒ»¸öÔÚÏÖʵÉú»îÖзdz£ºÃµÄMVCÀý×Ó¡£ÎÒÃÇ¿´³µ¶¼¿´Á½¸öView£¨ÏÔ Ê¾£©²¿·Ö£ºÄÚ²¿ºÍÍⲿ¡£¶øÕâÁ½¸ö¶¼Àë²»¿ªÒ»¸öController£ ......