Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    18
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Floating banner that shows once per visitor

    I have this floating banner code and I want to show it once per visitor. How could I have it to show once per visitor?


    <style>
    #floating_banner_bottom {
    text-align: left;
    width: 00%;
    bottom: 00px;
    margin-bottom: 0px;
    height: 50px;
    position: fixed;
    z-index: 50;
    left: 0px;
    </style>


    <div id="floating_banner_bottom">
    <!-- Button to Close Banner -->



    <a style="display:scroll;position:fixed;bottom:50px;left:0px">

    banner code

    <br />

    <div class="close">
    <a href="#" onclick="document.getElementById('floating_banner_bottom').style.display='none';return false;">


    <i style="font-family: Georgia,&quot;Times New Roman&quot;,serif;"><span style="background-color: #999999; color: white; font-size: small;"></span></i>

    <center>
    <img border="0" width="20" height="20" src="http://lh5.ggpht.com/_9vgJ1nwu_xA/S1jSp2ZhA7I/AAAAAAAAB8A/2AEBd4mR9qA/x.png" />
    </center>
    </a>
    </div>

    <a/>
    </a></a></div>
    <!-- End Here -->

  • #2
    Regular Coder
    Join Date
    Jul 2010
    Location
    Oregon City
    Posts
    280
    Thanks
    5
    Thanked 50 Times in 49 Posts
    try sessions

    or cookies for that matter

  • #3
    New Coder
    Join Date
    Oct 2011
    Posts
    18
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by bigvito19 View Post
    I have this floating banner code and I want to show it once per visitor. How could I have it to show once per visitor?


    <style>
    #floating_banner_bottom {
    text-align: left;
    width: 00%;
    bottom: 00px;
    margin-bottom: 0px;
    height: 50px;
    position: fixed;
    z-index: 50;
    left: 0px;
    </style>


    <div id="floating_banner_bottom">
    <!-- Button to Close Banner -->



    <a style="display:scroll;position:fixed;bottom:50px;left:0px">

    banner code

    <br />

    <div class="close">
    <a href="#" onclick="document.getElementById('floating_banner_bottom').style.display='none';return false;">


    <i style="font-family: Georgia,&quot;Times New Roman&quot;,serif;"><span style="background-color: #999999; color: white; font-size: small;"></span></i>

    <center>
    <img border="0" width="20" height="20" src="http://lh5.ggpht.com/_9vgJ1nwu_xA/S1jSp2ZhA7I/AAAAAAAAB8A/2AEBd4mR9qA/x.png" />
    </center>
    </a>
    </div>

    <a/>
    </a></a></div>
    <!-- End Here -->



    <?php
    # 24 hour cookie
    if (isset($_COOKIE["ad_shown"]))
    echo ""; //do nothing
    else
    echo "YOUR HTML AD CODE HERE";
    $expire=time()+60*60*24*1;
    setcookie("ad_shown", "1", $expire);
    ?>




    How would I imply that inside the code?

  • #4
    Regular Coder
    Join Date
    Jul 2010
    Location
    Oregon City
    Posts
    280
    Thanks
    5
    Thanked 50 Times in 49 Posts
    just do
    PHP Code:
    if(!isset($_COOKIE['ad_shown']))
    {
    //show banner
    setcookie( ... );

    then if they come back it checks for cookie set and if its set it wont do anything.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •