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

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











The solution to the Discuz background login problem is revealed. Specific code examples are needed. With the rapid development of the Internet, website construction has become more and more common, and Discuz, as a commonly used forum website building system, has been favored by many webmasters. However, precisely because of its powerful functions, sometimes we encounter some problems when using Discuz, such as background login problems. Today, we will reveal the solution to the Discuz background login problem and provide specific code examples. We hope to help those in need.

Build an autocomplete suggestion engine using PHP and Ajax: Server-side script: handles Ajax requests and returns suggestions (autocomplete.php). Client script: Send Ajax request and display suggestions (autocomplete.js). Practical case: Include script in HTML page and specify search-input element identifier.

Are you worried about WordPress backend garbled code? Try these solutions, specific code examples are required. With the widespread application of WordPress in website construction, many users may encounter the problem of garbled code in the WordPress backend. This kind of problem will cause the background management interface to display garbled characters, causing great trouble to users. This article will introduce some common solutions to help users solve the trouble of garbled characters in the WordPress backend. Modify the wp-config.php file and open wp-config.

Title: Methods and code examples to resolve 403 errors in jQuery AJAX requests. The 403 error refers to a request that the server prohibits access to a resource. This error usually occurs because the request lacks permissions or is rejected by the server. When making jQueryAJAX requests, you sometimes encounter this situation. This article will introduce how to solve this problem and provide code examples. Solution: Check permissions: First ensure that the requested URL address is correct and verify that you have sufficient permissions to access the resource.

jQuery is a popular JavaScript library used to simplify client-side development. AJAX is a technology that sends asynchronous requests and interacts with the server without reloading the entire web page. However, when using jQuery to make AJAX requests, you sometimes encounter 403 errors. 403 errors are usually server-denied access errors, possibly due to security policy or permission issues. In this article, we will discuss how to resolve jQueryAJAX request encountering 403 error

How to solve the problem of jQueryAJAX error 403? When developing web applications, jQuery is often used to send asynchronous requests. However, sometimes you may encounter error code 403 when using jQueryAJAX, indicating that access is forbidden by the server. This is usually caused by server-side security settings, but there are ways to work around it. This article will introduce how to solve the problem of jQueryAJAX error 403 and provide specific code examples. 1. to make

Using Ajax to obtain variables from PHP methods is a common scenario in web development. Through Ajax, the page can be dynamically obtained without refreshing the data. In this article, we will introduce how to use Ajax to get variables from PHP methods, and provide specific code examples. First, we need to write a PHP file to handle the Ajax request and return the required variables. Here is sample code for a simple PHP file getData.php:

MySQL transaction processing: the difference between automatic submission and manual submission. In the MySQL database, a transaction is a set of SQL statements. Either all executions are successful or all executions fail, ensuring the consistency and integrity of the data. In MySQL, transactions can be divided into automatic submission and manual submission. The difference lies in the timing of transaction submission and the scope of control over the transaction. The following will introduce the difference between automatic submission and manual submission in detail, and give specific code examples to illustrate. 1. Automatically submit in MySQL, if it is not displayed
