'How to add my html javascript popup to my php function? [duplicate]

I want to add my javascript popup code which is in an html file to my php function. It's a visitor counter in php. I want when visitors visit the page 4 times my popup html js is displayed



Solution 1:[1]

Do you just mean like this?

if ($increment == true) {
$compteur_actuel = $session->get('compteurClicsFreemium', 0);
$session->set('compteurClicsFreemium', $compteur_actuel+1);

if ($compteur_actuel > 4) {
    ?>
    <div>
        Your HTML code here
    </div>
    <?php
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 BogusFeet