abmcr Posted November 24, 2016 Share Posted November 24, 2016 (edited) I have developed a custom module with a ajax callIn my controller i create a token with $token = Tools::getToken(false); The token value is passed to the code javascript; into the js there is an ajax call to a file in /myModule/ajax.php Tha ajax call collect into the post data the token value Now how can validate the token data into the /myModule/ajax.php // ajax.php require_once dirname(__FILE__).'../../../config/config.inc.php'; require_once dirname(__FILE__).'../../../init.php'; //how to het the token value Thank you Edited November 24, 2016 by abmcr (see edit history) Link to comment Share on other sites More sharing options...
razaro Posted November 24, 2016 Share Posted November 24, 2016 Check also this http://build.prestashop.com/howtos/module/Common-mistakes-while-coding-module/ there is one tip about secure key. But do take notice on top comment there by shagshag, he gives great example. 1 Link to comment Share on other sites More sharing options...
abmcr Posted November 25, 2016 Author Share Posted November 25, 2016 Thank you.... now all work fine Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now