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