Php-php's jquery asynchronous request problem!

Source: Internet
Author: User
Keywords PHP asynchronous jquery
PHP asynchronous jquery

This is json.html.












function _getdata ()
{
var sid=$ ("#sid"). Val (); JQ gets the value entered by the user
$.ajax (
{
Type: "POST",
URL: "json.php",
data:{"stu_id": Sid},
Cache:false,
DataType: "JSON",
Success:function (MSN)
{
var content= "



"; $.each (Msn,function (i) {content+= " "; } ); content+= "
Id Name Professional Phone School Number
"+msn[i][0]+" "+msn[i][1]+" "+msn[i][2]+" "+msn[i][3]+" "+msn[i][4]+"
";
$ ("#test"). HTML (content);
}
});
}


This is json.php.
$sid =$_post["Sid"];
Include ' comm.php '; Connecting to a database
$sql = "Select * from Stu where stu_id={$sid}";
$result = mysql_query ($sql);
while ($row = Mysql_fetch_array ($result)) {
$arr [] = $row;
}
echo Json_encode ($arr);
    输入的数据不能通过ajax传到php页面处理!
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.