Ajax foreground submit data how to deal with the background, very simple!

Source: Internet
Author: User
Recently, the leadership assigned a task, the draw after the relevant data into the database, but PHP I am a beginner, do not know how to cooperate with the front desk
Let me simplify, basically this is the meaning of the database to insert ID and phone
var submitdata = {
tid:888,
Tel:tel,
Action: "Settel"
};
$.post (KKK.PHP?AA=CCC, submitdata,function)

How should I write the data in kkk.php? Assuming the database name is a, there are two fields called ID and Tel
Thank you!


Reply to discussion (solution)

$sql = "INSERT into A (ID, tel) values (' $_post[id] ', ' $_post[tel] ')");

Haha, I try, originally directly can $_post come over?

It's better to take a value or $_request.

3L What do you mean, I haven't tried, can you say something specific?

It is possible to use the INSERT statement directly when the parameter can be filtered directly using the $_post['] value.

  • 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.