Php 用ajax传递rel变量

Php 用ajax传递rel变量,php,jquery,ajax,wordpress,Php,Jquery,Ajax,Wordpress,我试图完成的是让变量$meta_value_pass通过ajax传递到另一个页面。这个页面应该选取变量,在循环中使用它,并输出并发回结果html 电话来源: $meta_value_pass = Entwerfen3; <script> jQuery(document).ready(function($){ alert ("helloworld"); $(".sorting").click(function() { var post_value = $meta_

我试图完成的是让变量$meta_value_pass通过ajax传递到另一个页面。这个页面应该选取变量,在循环中使用它,并输出并发回结果html

电话来源:

$meta_value_pass = Entwerfen3;
<script>
jQuery(document).ready(function($){

alert ("helloworld");
    $(".sorting").click(function()
{      
var post_value = $meta_value_pass;
jQuery("#projektwrapper")

            .empty()

            .html("<div style='text-align: center; padding: 30px;'>Loading...</div>");


jQuery.ajax({

            url: "http://web318.login-11.hoststar.at/ben/xarch/azall/?page_id=186",
            dataType: "html",
            type: "POST",
            data: ({player: post_value}),
            success: function(data) {
                jQuery("#projektwrapper").html(data); } 

  });
    });

});
</script>
$meta\u value\u pass=Entwerfen3;
jQuery(文档).ready(函数($){
警报(“helloworld”);
$(“.sorting”)。单击(函数()
{      
var post_value=$meta_value_pass;
jQuery(“项目包装器”)
.empty()
.html(“加载…”);
jQuery.ajax({
url:“http://web318.login-11.hoststar.at/ben/xarch/azall/?page_id=186",
数据类型:“html”,
类型:“POST”,
数据:({player:post_value}),
成功:功能(数据){
jQuery(“#projektwrapper”).html(数据);}
});
});
});
PHP处理变量并返回html:

    <?php

    /*
        Template Name: Projekte Getter
    */


    $meta_value_pass = $_POST['player'];

    $args= array(
    'meta_query' =>  array(
    array(
            'key' => 'cf_cf_Lehrveranstaltung',
            'value' => $meta_value_pass,
            'compare' => 'LIKE'
            ))
            );


   $the_query = new WP_Query( $args );
?>

而且,您无法在php中获取值?如果变量$meta\u value\u pass使用“Entwerfen3”,我将一无所获。但是如果我把它改成$(this.attr('rel');我得到一个答案,数组是空的。你不应该把它括起来传递给HTML吗?