Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 通过ajax将数据字符串发布到url_Php_Jquery_Ajax_Wordpress - Fatal编程技术网

Php 通过ajax将数据字符串发布到url

Php 通过ajax将数据字符串发布到url,php,jquery,ajax,wordpress,Php,Jquery,Ajax,Wordpress,我有一个从表单提交中收集数据的脚本。如果数据验证正确,它将创建一个数据字符串并将其发布到另一个URL(wordpress页面),该URL收集数据并将数据插入posts表 Wordpress URL工作正常,因为当我手动加载它时,它会创建所有帖子,但是当我通过ajax发布数据时,我的控制台显示URL返回404,但当我卷曲URL时,它返回200 该网站目前位于内部暂存URL上,因此我无法提供任何实际URL 任何援助都将是巨大的 控制台错误: Failed to load resource: t

我有一个从表单提交中收集数据的脚本。如果数据验证正确,它将创建一个数据字符串并将其发布到另一个URL(wordpress页面),该URL收集数据并将数据插入posts表

Wordpress URL工作正常,因为当我手动加载它时,它会创建所有帖子,但是当我通过ajax发布数据时,我的控制台显示URL返回404,但当我卷曲URL时,它返回200

该网站目前位于内部暂存URL上,因此我无法提供任何实际URL

任何援助都将是巨大的

控制台错误:

   Failed to load resource: the server responded with a status of 404 (Not Found) 
ajax代码:

submissionURL = "http://staging.ccc.site.edu.au/process/"
jQuery.ajax({
        type : "POST",
        url : submissionURL, 
        data : dataString,  
        success : function() {
            jQuery('form#enquiry_form_main').hide();
            jQuery('.enquiryMessage').html("<div id='SubmitMessage'></div>");
            jQuery('#SubmitMessage').html('<h3>Thank you for your enquiry</h3><p>One of our Staff managers will respond to your enquiry as soon as possible. </p><p>A copy of your request will be sent to your email address, along with any reply email. If you do not receive these please ensure you check your junk box. </p>').hide().fadeIn(1500, function() {
                jQuery('#message');
            });
        }
    });
submissionURL=”http://staging.ccc.site.edu.au/process/"
jQuery.ajax({
类型:“POST”,
url:提交url,
数据:dataString,
成功:函数(){
jQuery('form#enquiry_form_main').hide();
jQuery('.inquiryMessage').html(“”);
jQuery(“#SubmitMessage”).html('感谢您的询问我们的一位员工经理将尽快回复您的询问。

您的请求副本将与任何回复电子邮件一起发送到您的电子邮件地址。如果您没有收到这些电子邮件,请确保您选中垃圾邮件框。

').hide().fadeIn(1500,函数(){ jQuery(“#消息”); }); } });
控制台卷曲结果

 HTTP/1.1 200 OK
 Date: Thu, 29 May 2014 01:48:29 GMT
 Server: Apache/2.2.22 (Ubuntu)
 X-Powered-By: PHP/5.3.10-1ubuntu3.8
 X-Pingback: http://staging.ccc.site.edu.au/xmlrpc.php
 Link: <http://staging.ccc.site.edu.au/?p=680>; rel=shortlink
 Vary: Accept-Encoding
 Content-Type: text/html; charset=UTF-8
HTTP/1.1200正常
日期:2014年5月29日星期四格林尼治标准时间01:48:29
服务器:Apache/2.2.22(Ubuntu)
X-Powered-By:PHP/5.3.10-1ubuntu3.8
X-Pingback:http://staging.ccc.site.edu.au/xmlrpc.php
链接:;rel=短链接
改变:接受编码
内容类型:text/html;字符集=UTF-8

您使用什么命令发布curl?curl-I