Jump to content

Automatic trigger of Reminder in PHP


help_lucky

Recommended Posts

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. windows.alert('please call') then the popup should come for every 2 hrs.

 

Even though you navigate to different pages on the site..This should still come..

 

I have started something like this:--

1. Calling this script on everypage.

<script type="text/javascript">
alert_settimer();
</script>

And the code in the script is

function alert_settimer(){
    time_stop=2*60*60*1000;
    if(time_stop > 0) {
         timer= setTimeout("alert_settimer(),window.focus();window.alert('Please call Originator');",time_stop )
    }
}

 

It is able to give me a popup for every 2 hrs. But whenever the user reloads the page after 1 hr. The function is called again and the count starts from 0hrs again. OR for example if 20 mins already passed then if i am going to a new page then the function is called again and so the timer starts again.

I am not getting any idea how to restrict it calling every time. OR send that 1 hr again to the function so that it starts from there. I tried some thing like setting the value in a session variable and then starting the counter from that value. But i am not successful. Please help me in solving this...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.