Jump to content

Create token for ajax call in custom module


Recommended Posts

I have developed a custom module with a ajax call
In 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 by abmcr (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...