weixin_33749242 2020-03-23 08:25 采纳率: 0%
浏览 25

htaccess的Ajax Post问题

Actually my root htaccess looks

RewriteEngine On
RewriteBase /
RewriteRule ^en/functions/(.*)$ /functions/$1 [NC,L]
RewriteRule ^en/payments/(.*)$ /payments/$1 [NC,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

The site uses / and /en for multi language. There is a php script in /functions which is called thru Ajax post including variables. On / (main lang) the post is successful on /en the post looks good on debug and the variable seams to be send. But on the php side the variables does not seam to be received. On PHP side the variable will be used with $_POST['my-variable']. The system uses Wordpress.

Ajax Code: jQuery.ajax({ async: false, type: "POST", url: "/functions/pay", data: "bid="+bid+"&amount="+einsatz+"&paysystem="+payeer, success: function(data){ alert("Ok"); }});

PHP Code:

    $bid = $_POST["bid"];
    $paysystem = $_POST["paysystem"];
    $amount = $_POST["amount"];

Any idea why the $_POST Variables are not getting used when posting to /en ?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 数据量少可以用MK趋势分析吗
    • ¥15 使用VH6501干扰RTR位,CANoe上显示的错误帧不足32个就进入bus off快慢恢复,为什么?
    • ¥15 大智慧怎么编写一个选股程序
    • ¥100 python 调用 cgps 命令获取 实时位置信息
    • ¥15 两台交换机分别是trunk接口和access接口为何无法通信,通信过程是如何?
    • ¥15 C语言使用vscode编码错误
    • ¥15 用KSV5转成本时,如何不生成那笔中间凭证
    • ¥20 ensp怎么配置让PC1和PC2通讯上
    • ¥50 有没有适合匹配类似图中的运动规律的图像处理算法
    • ¥15 dnat基础问题,本机发出,别人返回的包,不能命中