I have a form, which add some data to DataBase.
<form>
<input type="text" name="mydata" />
<textarea name="mytext"></textarea>
<?php echo JHtml::_( 'form.token' );?>
<button type="submit">Submit</button>
</form>
Clicking Submit, I send data to outside script, which insert data to DB. I'm checking session token (to prevent csrf attack) and then make script actions. To do this, I use Joomla JSession method checkToken()
.
<?php
define( '_JEXEC', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/../..' ));
require_once ( JPATH_BASE. '/includes/defines.php' );
require_once ( JPATH_BASE. '/includes/framework.php' );
$mainframe = JFactory::getApplication('site');
$mainframe->initialise();
$session = JFactory::getSession();
$session->checkToken() or die('Access denied');
That's all good, when script look like above.
But when I init TinyMCE plugin for textarea, using tiny.cloud docs, I have "Access Denied" response from script.