提交表单后会话丢失

时间:2018-09-25 09:02:25

标签: php forms submit

我用PHP编写了包含四个步骤的表单。我用POST方法提交每个步骤。

我的步骤看起来像第一步:

    if(trim($_GET['p']) == 1){
        $_SESSION['rate_step'] = $_GET['p'];
        $_SESSION['data_change'] = @$_POST['change'];

        if(@$_POST['change'] != ''){
            $_SESSION['rate_disabled'] = '';
        }

        if(@$_POST['new_rate'] != ''){
            $_SESSION['rate_disabled'] = '';
            if($_SESSION['rate_lastinsertid'] != ''){
                $_SESSION['rate_lastinsertid'] = '';
            };
        }

        $extra_vis = 'display:none';
        $content = show_template('agent_rates_s1', array(   
                                                    'step' => $_SESSION['rate_step'],
                                                    'monat' => $monat,
                                                    'jahr' => $jahr,
                                                    'jahr_zukunft' => $jahrfut,
                                                    'zielland' => $zielland,
                                                    'herkunfstland' => $herkunfstland,
                                                    'service' => $_SESSION['rate_service'],
                                                    'month_service' => $_SESSION['rate_month'],
                                                    'year_service' => $_SESSION['rate_year'],
                                                    'origin_country' => $_SESSION['rate_origin_country'],
                                                    'destination_country' => $_SESSION['rate_destination_country'],
                                                    'city' => $_SESSION['rate_city'],
                                                    'street' => $_SESSION['rate_street'],
                                                    'postcode' => $_SESSION['rate_postcode'],
                                                    'floor' => $_SESSION['rate_floor'],
                                                    'disabled' => $_SESSION['rate_disabled'],
                                                    'extra_vis' => $extra_vis,

        ));
    }

当我单击导航中的另一个菜单项时,返回到我的表单,否则第一步字段为空。每个会话都是空的。为什么呢

是我使用$ _GET ['p'] == 1的问题吗?

0 个答案:

没有答案