Name-how does PHP accept ajax post forms and store TXT in different branches?

Source: Internet
Author: User
Tags form post
The JS code is as follows & quot; functionSubmitApply () {varformGlobal. getElement (& quot; # submitForm & quot;); varUserNameGlobal. getElement (form, & #39; input [name & quot; Name & quot;] & #39 ;). value; varMobileGlobal. getElement (form, & #39; input [name & quot; Tel & quot;] & #39 namephp form post

The JS code is as follows:

Function SubmitApply () {var form = Global. getElement ("# submitForm"); var UserName = Global. getElement (form, 'input [name = "Name"] '). value; var Mobile = Global. getElement (form, 'input [name = "Tel"] '). value; var Position = Global. getElement (form, 'input [name = "Position"] '). value; var Company = Global. getElement (form, 'input [name = "Company"] '). value; var ActId = Global. getElement (form, 'input [name = "Actid"] '). Value; if (Global. isNullOrWhitesapce (UserName) {Global. tip. tipError ("name required"); return;} if (Global. isNullOrWhitesapce (Mobile) {Global. tip. tipError ("mobile phone is required"); return;} if (/^ 1 [3 | 4 | 5 | 8] [0-9] \ d {} $ /. test (Mobile) = false) {Global. tip. tipError ("incorrect mobile phone format"); return;} var ajaxRequest = new HttpAjaxRequest (); ajaxRequest. ajax ({dataType: 'json', url: '', data: {name: UserName, mobile: Mobile, Companyname: Company, position: Position, actid: ActId}, successed: OnSubmitAppplySuccesse, error: function () {Global. Tip. TipError ('submission failed! '); GlobalPlayer. disableNext () ;}}) ;}/ *** name: Application submitted successfully */function OnSubmitAppplySuccesse (data) {if (data. code = 0) {Global. tip. tipMessage ('submitted successfully! '); Var form = Global. getElement ("# submitForm"); GlobalPlayer. enableNext (); GlobalPlayer. playNext (); form. reset ();} else {Global. tip. tipError ('submission failed! '+ Data. Message); GlobalPlayer. DisableNext ();}}

Which of the following good guys can help me write a complete PHP code to accept the source code? I am a little bit confused (already crying)

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.