POPUP in a php site

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • helplakshmi
    New Member
    • Dec 2009
    • 14

    POPUP in a php site

    Hello Everyone,

    I am banging my head since morning. please help me.. I am not so good at php..i am in learning phase...

    My requirement was to generate a popup once you immediately login. Then the user will have 3 options
    1. remind me later(input field so that the user can enter no. of hours).
    2. Canel for today,
    3. after 2 hours.

    If they specify the no.of hours as 'n' then a pop should come again after 'n' hours with 3 options again.

    If they click cancel for today popup should not come for today. eventhough they login and logout for many times.

    if they click cancel the pop should come after 2 hours.

    Even though they navigate to different pages on the site..This should still come..For example if they minimise my site and work on some other application(CAD ). Pop up should come on that screen(center).

    I have started something like this:--
    1. Calling this script on everypage conditionally. (It will check for time_stop). Display an alert message.
    But i am not successful.

    Code:
    alert_settimer();
    and the code in javascript:-

    Code:
    var timer;
    var time_stop
    function alert_settimer(){
        time_stop=5*1000;
        if(time_stop > 0) {
            timer= setTimeout("alert_settimer(),window.focus();window.alert('Please call Originator');",time_stop )
        }
    
    }
    This is how i started.. can you please to proceed further..

    Thanks in advance!!!
    Last edited by Atli; Mar 5 '10, 04:59 PM. Reason: Changed [quote] tags to [code] tags.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    This is more of a JavaScript thing, so I am going to relocate this thread over to the JavaScript forum.

    Code:
    Even though they navigate to different pages on the site..This should still come..For example if they minimise my site and work on some other application(CAD). Pop up should come on that screen(center).
    That would be a problem. The browser will not allow your website to bring up pop-ups like that. Firefox and Chrome will switch between tabs when a background tab brings up a pop-up, but IE won't even do that. (And I like IE's behavior more in this regard.)

    In any case, you really should try to find another, more passive, way to bring attention to your program. Getting pop-ups in your face while you are working is very annoying, and may even cause your users to just close the app. (I would.)

    Comment

    Working...