We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40109
    • 1 Posts
    Good day, I have a problem with a phx modifier - phx:session
    <?php
    return $_SESSION[$options];
    ?>
    


    In the beginning of template I have a snippet [!sessions!]
    <?php
    if (isset($_POST['room'])) { $_SESSION['room'] = $_POST['room'];} else { $_SESSION['room'] = $_SESSION['room'];}
    ?>
    


    And form:
    <form action="[~[*id*]~]" method="post">
    <select name="room">
    <option [*phx:if=`[*phx:session=`room`*]`:is=``:then=`value="" SELECTED`:else=`value=""`*] >any</option>
    <option [*phx:if=`[*phx:session=`room`*]`:is=`1`:then=`value="1" SELECTED`:else=`value="1"`*] >1</option>
    <option [*phx:if=`[*phx:session=`room`*]`:is=`2`:then=`value="2" SELECTED`:else=`value="2"`*] >2</option>
    <option [*phx:if=`[*phx:session=`room`*]`:is=`3`:then=`value="3" SELECTED`:else=`value="3"`*] >3</option>
    </select>
    <input type="submit" value="Send">
    </form>
    


    So I have the following problem:
    Snippet and modifier return different values. Example with comments: stilo.kz
    Any solutions?
    Thanks.