I am trying to use Ajax to pass some data to php file from smarty template.
In template in javascript:
$(document).ready(function() {
$(".redeem-button").click(function(){
var test = 'test';
$.ajax({
url: 'modules/Custom/ajaxtest.php',
data: {test: test},
type: 'POST',
success: function (data) {
$(".apply-left").html(data);
}
});
});
});
When I test it, I get this error in console:
POST http://localhost/xcart/modules/Custom/ajaxtest.php 403 (Forbidden)
I tried to add:
require_once 'http://localhost/xcart/auth.php';
in ajaxtest.php but still no luck...
How do I make it work?
Version 4.7.6 X-cart Gold
The possible reason is
In this case add this code to your modules/Custom/.htaccess file