您好,欢迎访问一九零五行业门户网

ajax提交不到后台

php做一个短信验证的,ajax提交过去之后没反应
//002.根据手机号反回验证码,function getnum(){ if($(#tel).val()== || $(#tel).val()==null){ // 手机号为空校验 alert('提示:请输入手机号'); }else{ // 提交数据 $.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) { // 返回-1.手机号格式 不对 if($.parsejson(data).ret==-1){ $(#tel).focus(); $(#tel).val(); alert('提示:请输入正确的手机号码!'); }else{ $(#num).val($.parsejson(data).ret); } } }); }}
//接口参数$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';}
回复讨论(解决方案) 这个调试很简单的
php 什么都注释掉,直接echo一个字符串,看有没有东西返回
看看firebug有什么提示。
是不是跨域了?
1.检查提交之后,firebug的console是否报错。
2.提交的时候,追踪下url路径,看返回值是什么?
用firebug 等工具抓包看看,有什么返回
找到原因, 一个文件打不开
1.检查提交之后,firebug的console是否报错。
2.提交的时候,追踪下url路径,看返回值是什么?
warning: include() [function.include]: failed opening '/data/webserver/sites/diyiwuxian/lib/auth.php' for inclusion (include_path='.:/data/webserver/php/lib/php') in /data/webserver/sites/ht/include/inc.php on line 16
文件问题,这是怎么回事? 文件 /data/webserver/sites/diyiwuxian/lib/auth.php 不存在
请注意大小写
其它类似信息

推荐信息