In an xenforo page using xen:callback under template HTML i'm having some problems submitting a custom form.
Template HTML:
<xen:callback class="Calendar_Installer" method="getHtml"><xen:require css="characterinfo.css"/>
</xen:callback>
Installer contains this:
<form action="" method="post">
<input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
<textarea name="wstxt" id="wstxt" cols="40" rows="5"></textarea>
<input type="submit" name="submit" value="submit" />
</form>
I then use PHP to handle the submission
<?php
if(isset($_POST['submit'])) {
<<Executes SQL query>;
}
?>
When i submit i get the following:
Security error occurred. Please press back, refresh the page, and try again.
I had read this was due to csrf_token not being passed in through the form but i added that and still have the same error. Any suggstions or can i provide some additional inforomation that might help?
*Edit this all works find when calling the php code outside of xenforo.
Template HTML:
<xen:callback class="Calendar_Installer" method="getHtml"><xen:require css="characterinfo.css"/>
</xen:callback>
Installer contains this:
<form action="" method="post">
<input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
<textarea name="wstxt" id="wstxt" cols="40" rows="5"></textarea>
<input type="submit" name="submit" value="submit" />
</form>
I then use PHP to handle the submission
<?php
if(isset($_POST['submit'])) {
<<Executes SQL query>;
}
?>
When i submit i get the following:
Security error occurred. Please press back, refresh the page, and try again.
I had read this was due to csrf_token not being passed in through the form but i added that and still have the same error. Any suggstions or can i provide some additional inforomation that might help?
*Edit this all works find when calling the php code outside of xenforo.