View Single Post
  #1  
Old 12-18-2016, 04:36 AM
  acidon's Avatar 
acidon acidon is offline
 

Senior Member
  
Join Date: Feb 2008
Posts: 139
 

Default Using ajax calls in template - 403 Forbidden Error

I am trying to use Ajax to pass some data to php file from template.

In template in javascript:


Code:
$(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:

Code:
POST http://localhost/xcart/modules/Custom/ajaxtest.php 403 (Forbidden)

I tried to add:

Code:
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