Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

php ajax mysql±àÂëgb2312

 1¡¢PHP·¢ËÍÖÐÎÄ¡¢Ajax½ÓÊÕ
Ö»ÐèÔÚphp¶¥²¿¼ÓÈëÒ»¾ä£º
header('Content-type: text/html;charset=GB2312');
xmlHttp»áÕýÈ·½âÎöÆäÖеÄÖÐÎÄ¡£
2¡¢Ajax·¢ËÍÖÐÎÄ¡¢PHP½ÓÊÕ
Õâ¸ö±È½Ï¸´ÔÓ£º
AjaxÖÐÏÈÓÃencodeURIComponent¶ÔÒªÌá½»µÄÖÐÎĽøÐбàÂë
PHPÖУº
$GB2312string=iconv( ‘UTF-8′, ‘gb2312//IGNORE’ , $RequestAjaxString);
3¡¢PHPдÈëMySQLÊý¾Ý¿â
½¨Á¢connʱ£¬queryÒ»ÏÂset names “gb2312″


Ïà¹ØÎĵµ£º

Ajax ½øÐÐPost´«ÖµºÍGet´«Öµ £¨¾­µä£©

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<script language="javascript">
function saveUserInfo()
{
//»ñÈ¡½ÓÊÜ·µ»ØÐÅÏ¢²ã
var msg = document.getElementById("msg");
//»ñÈ¡±íµ¥¶ÔÏóºÍÓ ......

ÓÃAjax¶ÁÈ¡xmlÎļþµÄ¼òµ¥Àý×Ó

 AjaxµÄÔ­ÀíºÜ¼òµ¥£¬¾ÍÊÇÔÚ¿Í»§¶Ë´´½¨Ò»¸öXMLHttpRequest¶ÔÏó£¨ÓÃÀ´Óë·þÎñÆ÷½øÐÐÒ첽ͨÐÅ£¬Õâ¾ÍÊÇAjaxµÄºËÐÄ£¬ÆäʵÎÒÃÇÔç¾ÍÔÚÓÃÒ첽ͨÐÅÁË£¬Ö»ÊÇû°ÑÕâÏî¼¼ÊõÓÃÔÚÍøÒ³Éè¼ÆÖжøÒÑ£©£¬Îª¸Ã¶ÔÏóµÄonreadystatechange ÊôÐÔÌí¼ÓÒ»¸öʼþ£¬µ±¶ÔÏóµÄreadyState¸Ä±äµÄʱºò¾Í»áÒý·¢Ö¸¶¨µÄʼþ¡£µ½´Ë¾Í¿ÉÒԾͷ¢ËÍÇëÇó¶ÁÈ¡·þÎñÆ÷¶ ......

LinuxÍø¹Ü±Ê¼Ç£¨24£©ÖØÐÂÕÒµ½MySQLÊý¾Ý¿âµÄrootÃÜÂë

Íü¼ÇMySQL ROOTÃÜÂëÊÇÔÚMySQLʹÓÃÖкܳ£¼ûµÄÎÊÌ⡣ûÏëµ½½ñÌì¾ÍÅöµ½ÕâÑùÒ»¸öÎÊÌ⣺ÄÚ²¿µÄmysqlµÄrootÃÜÂë±»ÐÞ¸ÄÁË¡£²éÔÄ×ÊÁÏ£¬ÓÐÈçÏ·½·¨£º Unix&Linux£º
1.ÓÃroot»òÕßÔËÐÐmysqldµÄÓû§µÇ¼ϵͳ£»
2£®ÀûÓÃkillÃüÁî½áÊøµômysqldµÄ½ø³Ì£»
3£®Ê¹ÓÃ--skip-grant-tables²ÎÊýÆô¶¯MySQL Server
shell& ......

linuxÏ¿ìËÙ°²×°apache+php+mysql

 £¨1£©¡¢yum°²×°mysql
//yum°²×°
yum -y install mysql mysql_server
//ÔÚ·þÎñÇåµ¥ÖÐÌí¼Ómysql·þÎñ
chkconfig --add mysqld
//·þÎñÆô¶¯
service mysqld start
//³õʼ»¯mysqlÊý¾Ý¿â
/usr/bin/mysql_secure_installation
£¨2£©¡¢°²×°apache
yum -y install httpd
service httpd start
Ìí¼ÓiptablesÔÊÐí·Ã ......

php ͨ¹ýinclude·½Ê½ÊµÏÖ¹ú¼Ê»¯¶àÓïÑÔ(i18n)

includeʵÏÖ¹ú¼Ê»¯
½«index.php½øÐз­Òë:
IndexÄÚÈÝ
1.         Index
2.         About us
ÎÒÃÇ¿ÉÒÔ½«index.phpÉèÖÃΪһ¸ö·­ÒëÄ£°æ£¬ËùÓгöÏÖ×Ö·ûµÄµØ·½£¬¶¼¶¨ÒåΪ±äÁ¿£¬Èç1£¬2²¿·ÖÉèÖÃΪ·­ÒëµÄ±äÁ¿$menu_index, $menu_aboutus.
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ