There is some static page. By default, it is the main one. How can I make it so that when a user visits this page, the user is set up with a parameter, and in a subsequent visit to the same page, he redirects to another. Type something like A / B testing.

    1 answer 1

    So do. in the session write a checkbox

    $_SESSION['mainpage']=1 

    and if there is already a flag in the session

      if isset(isset($_SESSION['mainpage']) {header('location: otherpage.php');exit;} 

    issue a redirect header. if it is also necessary for the user to bind (authorized), then in his properties write this flag and, when authorized, write it to the session.

    • It's clear. It is not clear exactly where to insert it. Which file? - or_die
    • in the main page file. closer to the beginning, first condition, then assignment. - zb '
    • And what is it called? What is at the root of the VP is index.php? - or_die
    • in the template header.php changed - or_die