¹ØÓÚExt.AjaxÇëÇóPHPµÄÎÊÌâ - Web ¿ª·¢ / Ajax
дÁËÒ»¸öExtµÄAjaxʾÀý,ÆäÖе±ÎÒµÄURL¶¨Ïòµ½ServletµÄʱºò,³É¹¦,·µ»ØÕý³£½á¹û,ÓÃfirebug²é¿´"ÏìÓ¦"²¿·Ö,µÃµ½µÄÊÇÒ»¸öjson×Ö·û´®{data : '11111'}
Ò³Ãæµ÷ÓÃ:
JScript code:
var jsonString = Ext.util.JSON.decode(response.responseText);
Ext.MessageBox.alert("result : ", jsonString.data);
Servlet´úÂë:
Java code:
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
String username = request.getParameter("username");
String password = request.getParameter("password");
System.out.println(username + "\t" + password);
PrintWriter out = response.getWriter();
out.println("{data : '11111'}");
out.flush();
out.close();
}
µ«Êǵ±ÎÒµÄURL¶¨Ïòµ½phpµÄʱºò£¬³É¹¦Êdzɹ¦ÁË,µ«·µ»ØµÄ½á¹ûÊÇÕû¸öPHPÎļþµÄ´úÂë,È»ºóalert³öÀ´ÊÇ¿ÕÖµ,firebugÀïµÄ"ÏìÓ¦²¿·ÖÊÇÕû¸öPHPÎļþµÄ´úÂë,²»ÊÇjson×Ö·û´®",ÒªÔõô×ö²ÅÄÜÄõ½"data"Õâ¸öÖµ?
php´úÂë:
PHP code
Code highlighting produced by Actipro CodeHighlighter
Ïà¹ØÎÊ´ð£º
´úÂëÖУ¬Èç¹û½«//alert(1)¡¡×¢ÊÍ´ò¿ª£¬ÄÇô¾Í¿ÉÒÔµ÷Óã¬Èç¹û×¢Ê͵ô¾ÍÎÞ·¨µ÷ÓÃ
»³ÒÉÊǵ¼JSÎļþ³öÎÊÌâÁË£¬ÒòΪд¹ýjspÒýÁ½¸öJSÎļþûÎÊÌ⣬
¶øJSPÒýÒ»¸öJSÎļþ£¬Õâ¸öJSÒý±ðÍâµÄJSÎļþ³öÏÖÏÂÃæÎÊÌ⣬ÉÏÍøÕÒÁË°ëÌìû½á ......
Ä¿Ç°Ò»¸öÏîÄ¿£¬Óöµ½¸ö´óÎÊÌ⣬Ҫ¸ãÒ»¸öµç×ÓµØͼ£¬Ð¡µÜ´ÓÀ´Ã»¸ã¹ýgis·½ÃæµÄ¶«Î÷£¬Õâ´ÎÓ²×ÅͷƤÉÏÁË¡£ ÏÂÃæÊÇÄ¿Ç°Óöµ½µÄ¸öÎÊÌâ¡£¡£¡£
OpenLayerÔõôÏòºǫ́·¢ËÍajaxÇëÇ󣨺ǫ́ÊÇSSH¿ò¼Ü£©£¬ÔÚÉêÇëµ½ºǫ́µÄactionºó£¬²é ......
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Çý¶¯³ÌÐò¹ÜÀíÆ÷] δ·¢ÏÖÊý¾ÝÔ´Ãû³Æ²¢ÇÒδָ¶¨Ä¬ÈÏÇý¶¯³ÌÐò, SQL state IM002 in SQLConnect in D:\0\msc\msc\tel.php on line 44
Í ......
PHPÖÐ ÉùÃ÷±äÁ¿µÄʱºòÒ»¸ö$¸úÁ½¸ö$µÄÇø±ð
±ÈÈç˵
$var="333"; ±íʾ±äÁ¿ÃûΪ$varµÄ±äÁ¿µÄֵΪ333
$var="myvar";$$var="333";±íʾ±äÁ¿ÃûΪ$myvarµÄ±äÁ¿µÄֵΪ333
ÕâÑù˵Çå³þÁËÂð£¿
......