search

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 不存在
请注意大小写

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Discuz后台登录问题解决方法大揭秘Discuz后台登录问题解决方法大揭秘Mar 03, 2024 am 08:57 AM

Discuz后台登录问题解决方法大揭秘,需要具体代码示例随着互联网的快速发展,网站建设变得越来越普遍,而Discuz作为一款常用的论坛建站系统,受到了许多站长的青睐。然而,正是因为其功能强大,有时候我们在使用Discuz的过程中会遇到一些问题,比如后台登录问题。今天,我们就来大揭秘Discuz后台登录问题的解决方法,并且提供具体的代码示例,希望能帮助到有需要

WordPress后台乱码烦恼?试试这些解决方案WordPress后台乱码烦恼?试试这些解决方案Mar 05, 2024 pm 09:27 PM

WordPress后台乱码烦恼?试试这些解决方案,需要具体代码示例随着WordPress在网站建设中的广泛应用,许多用户可能会遇到WordPress后台乱码的问题。这种问题会导致后台管理界面显示乱码,给用户的使用带来极大困扰。本文将介绍一些常见的解决方案,帮助用户解决WordPress后台乱码的烦恼。修改wp-config.php文件打开wp-config.

jquery ajax报错403怎么办jquery ajax报错403怎么办Nov 30, 2022 am 10:09 AM

jquery ajax报错403是因为前端和服务器的域名不同而触发了防盗链机制,其解决办法:1、打开相应的代码文件;2、通过“public CorsFilter corsFilter() {...}”方法设置允许的域即可。

什么是ajax重构什么是ajax重构Jul 01, 2022 pm 05:12 PM

ajax重构指的是在不改变软件现有功能的基础上,通过调整程序代码改善软件的质量、性能,使其程序的设计模式和架构更合理,提高软件的扩展性和维护性;Ajax的实现主要依赖于XMLHttpRequest对象,由于该对象的实例在处理事件完成后就会被销毁,所以在需要调用它的时候就要重新构建。

Nginx中404页面怎么配置及AJAX请求返回404页面Nginx中404页面怎么配置及AJAX请求返回404页面May 26, 2023 pm 09:47 PM

404页面基础配置404错误是www网站访问容易出现的错误。最常见的出错提示:404notfound。404错误页的设置对网站seo有很大的影响,而设置不当,比如直接转跳主页等,会被搜索引擎降权拔毛。404页面的目的应该是告诉用户:你所请求的页面是不存在的,同时引导用户浏览网站其他页面而不是关掉窗口离去。搜索引擎通过http状态码来识别网页的状态。当搜索引擎获得了一个错误链接时,网站应该返回404状态码,告诉搜索引擎放弃对该链接的索引。而如果返回200或302状态码,搜索引擎就会为该链接建立索引

MySQL事务处理:自动提交与手动提交的区别MySQL事务处理:自动提交与手动提交的区别Mar 16, 2024 am 11:33 AM

MySQL事务处理:自动提交与手动提交的区别在MySQL数据库中,事务是一组SQL语句的集合,要么全部执行成功,要么全部执行失败,保证了数据的一致性和完整性。在MySQL中,事务可以分为自动提交和手动提交,其区别在于事务提交的时机以及对事务的控制范围。下面将详细介绍自动提交和手动提交的区别,并给出具体的代码示例来说明。一、自动提交在MySQL中,如果没有显示

ThinkPHP6后台管理系统开发:实现后台功能ThinkPHP6后台管理系统开发:实现后台功能Aug 27, 2023 am 11:55 AM

ThinkPHP6后台管理系统开发:实现后台功能简介:随着互联网技术和市场需求的不断发展,越来越多的企业和组织需要一个高效、安全、灵活的后台管理系统来管理业务数据和进行运营管理。本文将使用ThinkPHP6框架,通过实例演示如何开发一个简单但实用的后台管理系统,包括权限控制、数据增删改查等基本功能。环境准备在开始之前,我们需要安装好PHP、MySQL、Com

Win11禁止软件后台运行的方法?Win11禁止软件后台运行的方法?Jun 30, 2023 am 08:17 AM

win11如何禁止软件后台运行?我们在使用一些软件,不使用的时候,我们就会关闭掉软件,有些软件关闭后还会在后台运行,在后台运行的过程中,电脑会造成一定的卡顿,就有小伙伴想知道应该如何在win11中禁止软件后台运行。小编下面整理了win11禁止软件后台运行步骤,感兴趣的话,跟着小编一起往下看看吧!win11禁止软件后台运行步骤1、按下快捷键“win+X”,在上方给出的选项中选择“设置”。2、进入新界面后,点击“应用”,接着找到右侧中的“应用和功能”。3、在其中,找到“Microsoft资讯”,点击

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!