admin管理员组

文章数量:1289868

  1. There is a password protected page.
  2. There is a link in the single page, clicking on it opens the "Popup Maker" modal window.
  3. Content from the password-protected page from point 1 is loaded into this modal window.
  4. If the password was not entered or entered incorrectly in the modal window there is a form for entering the password, if the password is entered correctly, we see the necessary content.

Everything works correctly, except for one thing, after the user entered the correct password, the page reloads and this is where everything ends. To see the content, you need to click on the link from point 2 again. This is very inconvenient.

Please tell me how to make the modal window open again immediately after entering the password and reloading the page, as well as at any time by clicking on the link from paragraph 2?

  1. There is a password protected page.
  2. There is a link in the single page, clicking on it opens the "Popup Maker" modal window.
  3. Content from the password-protected page from point 1 is loaded into this modal window.
  4. If the password was not entered or entered incorrectly in the modal window there is a form for entering the password, if the password is entered correctly, we see the necessary content.

Everything works correctly, except for one thing, after the user entered the correct password, the page reloads and this is where everything ends. To see the content, you need to click on the link from point 2 again. This is very inconvenient.

Please tell me how to make the modal window open again immediately after entering the password and reloading the page, as well as at any time by clicking on the link from paragraph 2?

Share Improve this question asked Jun 30, 2021 at 8:24 VladSiyVladSiy 57 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I solved the problem in this way. Maybe someone will need it.

  1. Configured the modal window so that a cookie is created when the window is closed.
  2. Launched a modal window until the user closes the window and a cookie is created.

Here is the code:

...
if ( ! isset( $_COOKIE["pum-909"] ) ) { ?>
    <script>
        setTimeout(function() {
            PUM.open('909'); // This is my popup class "popmake-909"
        }, 1000);
    </script>
<?php }
...

本文标签: phpHow do I reopen the (Popup Maker) after entering the correct password for a password protected page