Data transmission-php Tutorial

Source: Internet
Author: User
Data transmission
Table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" class = "ttbb5">    Serial Number    Country    ProvinceRegion    Operation      {If $ list or $ list | @ count neq 0} {foreach from = $ list item = item key = index}    {$ Index}{If $ item. parent_tow_id eq 2}{$ Item. country}{$ Item. province}    {$ Item. name}{/If} {if $ item. parent_tow_id eq 1}{$ Item. country}{$ Item. name}    {/If} {if $ item. parent_tow_id eq 0}{$ Item. name}    {/If}  

{/Foreach} {else} -- No data -- {/If}{Include file = warning. tpl}


Input = text: the database sorting value is displayed. modify the value in the text box and click "OK". how can I import the database to change the paixu value?


Reply to discussion (solution)

After ajax is used to obtain data, it is asynchronously transmitted to php

You can use jquery to determine whether to click the MODIFY operation, and then use ajax to modify the value in php before returning information.

Click "OK" to obtain the id and paixu value of the current column, send the value to the controller, and modify the paixu value based on the primary key id. if the value is successful, 1 is returned, 0 is returned for failure. If 1 is received in the callback function, alert succeeds; otherwise, alert fails.

You can also directly form the entire form into a form. the Input name is {$ item. id}, and the value is {$ item. paixu }.
Submit to the controller. foreach traverses $ _ POST, $ k as the id, $ v as the paixu value, and insert one by one to the data table.

Click "OK" to obtain the id and paixu value of the current column, send the value to the controller, and modify the paixu value based on the primary key id. if the value is successful, 1 is returned, 0 is returned for failure. If 1 is received in the callback function, alert succeeds; otherwise, alert fails.

You can also directly form the entire form into a form. the Input name is {$ item. id}, and the value is {$ item. paixu }.
Submit to the controller. foreach traverses $ _ POST, $ k as the id, $ v as the paixu value, and insert one by one to the data table.


If this doesn't happen, then you can call this method through ajax. how can this be called?

Refer to the manual. it is more convenient to use jQuery for ajax operations than to use native ajax. For more information, see the manual.
Http://www.php100.com/manual/jquery/

I really don't want to use ajax to send it. I will use the second method I mentioned to directly send it to the controller for processing, but I need to change the template code.

Refer to the manual. it is more convenient to use jQuery for ajax operations than to use native ajax. For more information, see the manual.
Http://www.php100.com/manual/jquery/

I really don't want to use ajax to send it. I will use the second method I mentioned to directly send it to the controller for processing, but I need to change the template code.


But thank you.

Jquery asynchronously Acquires Data. js requests are sent once and the pid of the previous level is passed. the object returns the data of the next level.

Ajax can reference http://www.w3school.com.cn/jquery/jquery_ajax_get_post.asp

Jquery asynchronously Acquires Data. js requests are sent once and the pid of the previous level is passed. the object returns the data of the next level.


Can you help write down the code? I won't.

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.