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
    Jan 2010
    Posts
    34
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Post need change script

    Hi
    i need your help about below codes
    The problem is scripts open popup whenever i click on page , i want they work one time Or at least works few minute after first click

    Code:
    function Show() {
    
    PopShow();
    PopShow3();
    
    } 
    
    function PopShow3() {  
    den = Math.floor( Math.random() * (9000 - 1 + 1) ) + 1;
    max = Math.floor( Math.random() * (9000 - 1 + 1) ) + 1;
    
    bu = window.open('http://msn.com', max ,"width=4000,height=4000,resizable=1,toolbar=1,location=1,menubar=1,status=1,scrollbars=1"); bu.blur(); window.focus(); 
    
     
    
    }  
    document.onmouseup=Show;
    Code:
    d = 0;
    function PopShow() {  
    dena = Math.floor( Math.random() * (9000 - 1 + 1) ) + 1;
    
    if (d==0) { pu = window.open('goo.php', dena ,"width=4000,height=4000,resizable=1,toolbar=1,location=1,menubar=1,status=1,scrollbars=1"); pu.blur(); window.focus(); d = 1;} 
      else d = 1;
     
    
    }

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,731
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    If you want the window to open only once, you will need to use a cookie. Many examples in this forum if you use the search feature.

    It is your responsibility to die() if necessary….. - PHP Manual

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New Coder
    Join Date
    Jan 2010
    Posts
    34
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    If you want the window to open only once, you will need to use a cookie. Many examples in this forum if you use the search feature.

    It is your responsibility to die() if necessary….. - PHP Manual
    can u please write for me exact code for set cookie

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,731
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Have a look at http://www.quirksmode.org/js/cookies.html.

    This forum is not a free coding service. As a general rule, the people helping out in this forum don't write code for others but try to help with fixing code that doesn't work. You may perhaps get someone to write this script for you, but you'll be far more likely to get help if you have made a substantial effort and written some code yourself. Then someone here will almost certainly help you correct/improve your work.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

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