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:
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? |
Re: Using ajax calls in template - 403 Forbidden Error
Usually, you don't call the modules directory directly in a script. Try placing your ajaxtest.php in the root directory.
|
Re: Using ajax calls in template - 403 Forbidden Error
This error is probably because /modules/.htaccess has "deny from all". Don't circumvent this security but call a php file outside of this directory.
Off the top of my head you may want to start with one of the Block examples like:
|
Re: Using ajax calls in template - 403 Forbidden Error
Quote:
Moving ajaxtest.php to root solved the problem! Thanks a lot, sir! Quote:
Thanks for these references, already found some good bits there! |
All times are GMT -8. The time now is 07:03 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.