Submitting form from the welcome page [SOLVED]

Hi Anton,

I’m using playsms 1.0. I’m showing a report (that I get from an api) in the welcome page (home). Everything works fine (the first time it loads because I use default date params), but I want to apply some date filters to update the report. I’m trying to submit the date filters to the welcome.php using a form. The problem is that when I submit the form I get an error message telling me that “You have no access to this page”. Is there a problem in my form markup?

My form:

<form name="fm_welcome" id="fm_welcome"
    action="index.php?app=main&inc=core_welcome"
    method="POST" role="form">
            
    <div class="row">
        <div class="col-sm-4">
                <div class="form-group">
                        <label for="from">{{ from }}</label>
                        <div class="input-group date" id="dp_from" style="width: 100%">
                                <input type="text" name="dp_from" class="form-control"
                                        value="{{ from }}" /> <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-calendar"></span>
                                </span>
                        </div>
                        <p class="help-block">{{ HINT_DATE_FORMAT }}</p>
                </div>            
        </div>
        <div class="col-sm-4">
                <div class="form-group">
                        <label for="to">{{ to }}</label>
                        <div class="input-group date" id="dp_to" style="width: 100%">
                                <input type="text" name="dp_to" class="form-control"
                                        value="{{ to }}" /> <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-calendar"></span>
                                </span>
                        </div>
                        <p class="help-block">{{ HINT_DATE_FORMAT }}</p>
                </div>
        </div>
        <div class="col-sm-4">
                <div class="form-group" style="margin-top: 28px;">
                        <input type=submit class=button value='{{ Update }}'>
                </div>
        </div>
    </div>
    
</form>

Cheers,

This validation in init.php file was causing my problem:

if (!((_APP_ == 'ws') || (_APP_ == 'webservices') || ($core_config['init']['ignore_csrf']))) {
    
    // print_r($_POST); print_r($_SESSION);
    if ($_POST) {
        if (!core_csrf_validate()) {
            logger_print('WARNING: possible CSRF attack. sid:' . $_SESSION['sid'] . ' ip:' . $_SERVER['REMOTE_ADDR'], 2, 'init');
            auth_block();
                    
        }
    }
    $csrf = core_csrf_set();
    define('_CSRF_TOKEN_', $csrf['value']);
    define('_CSRF_FORM_', $csrf['form']);
    unset($csrf);
}