Ajax cannot be submitted to the background

Source: Internet
Author: User
Ajax cannot submit a text message for verification in the background PHP. ajax does not respond after it is submitted.
// 002. return the verification code based on the mobile phone number. function getnum () {if ($ ("# tel "). val () = "" | $ ("# tel "). val () = null) {// if the mobile phone number is null, alert is verified ('prompt: enter the mobile phone number ');} else {// submit data $. ajax ({type: "get", url: "http://www.diyiwuxian.com/tools/index.php? C = Phone & m = getactnum ", async: true, dataType:" html ", data: {tel: $ (" # tel "). val ()}, success: function (data) {// return-1. incorrect mobile phone number format if ($. parseJSON (data ). ret =-1) {$ ("# tel "). focus (); $ ("# tel "). val (""); alert ('prompt: enter the correct mobile phone number! ');} Else {$ ("# num"). val ($. parseJSON (data). ret );}}});}}


// Interface parameter $ classCName =@ _ GET ['c']? $ _ GET ['c']: ''; $ method =@ _ GET ['M']? $ _ GET ['M']: ''; $ method = isset ($ method )? $ Method: "index"; if (! $ ClassCName |! $ Method) {echo "controller or method is null"; exit () ;}$ classCName = $ classCName. "Controller"; if (file_exists (HTDOC. 'gmcontrollers /'. $ classCName. ". php ") {require_once (HTDOC. 'gmcontrollers /'. $ classCName. ". php "); $ objC = new $ classCName; if (method_exists ($ classCName, $ method) return $ objC-> $ method (); else echo" class: {$ classCName} not has method {$ method} ";} else {echo 'no file ';}


Reply to discussion (solution)

This debugging is very simple
Php commented out everything and directly echo a string to see if anything is returned.

Let's see what the firebug prompts are.

Is it cross-origin?

1. check whether the firebug console reports an error after submission.
2. when submitting the request, track the url path to see what the return value is?

Use tools such as firebug to capture packets. What are the returned results?

Find the cause. a file cannot be opened.

1. check whether the firebug console reports an error after submission.
2. when submitting the request, track the url path to see what the return value is?


Warning: include () [function. include]: Failed opening '/data/webserver/sites/diyiwuxian/lib/Auth. php 'for declaration (include_path = '. :/data/webserver/php/lib/php') in/data/webserver/sites/ht/include/inc. php on line 16
File problems, what is the problem?

File/data/webserver/sites/diyiwuxian/lib/Auth. php does not exist
Note the case sensitivity

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.