A post-related question

Source: Internet
Author: User
Ask a post question & nbsp; the environment is ThinkPHP3.1. Now I use jquery to post a file. php files. $. post ('_ APP _/Main/doWriteText', {"AddText": AddText}, function (data ){...} in this way, I would like to ask you a post question.
The environment is ThinkPHP3.1. Now I use jquery to post a file. php files. $. post ('_ APP _/Main/doWriteText', {"AddText": addtext,,function(data=)...htm) this example goes to post(template is main.html, then this class library is/lib/Action/MainAction. class. php), but then I referenced a class library and put it under lib/ORG. how do I write the url when I want to post a function? Above ('_ APP _/Main/doWriteText. Thank you very much!
------ Solution --------------------
The post receiver must be the controller. you can create a controller and then call the function/method you are processing in this controller.
------ Solution --------------------
ThinkPHP url format
_ APP _/module/action/name/value /...

Therefore, Main/doWriteText calls the MainAction: doWriteText method.
ThinkPHP is not bound with what to do and how to do this method.

Although the same parameter is processed, $ _ POST should be retained. Of course, this need to be confirmed
If the code does not exist, you need to restore the code. Otherwise, the code cannot be modified too much.

$ _ POST is a super global variable and can be directly used as long as it exists without additional declaration.

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.