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条回答 默认 最新

    报告相同问题?