republican-creole
Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » Tech and Talk » OS and Software » Webmasters and Developers » at a spcified time load this....
Search Topic:
Uniqs:
62
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
Where are MySQL errno codes found? »
« phpbb 2.0.4 to 2.0.6  
AuthorAll Replies


Overdrive
Are You Where You Want To Be?
Premium
join:2001-05-31
Waterbury, CT

at a spcified time load this....

Is there a way to load something at a specified time?

like if I click on a page and at 10 am a script loads that pops up a new page? I am not doing pop-up ADs just a pop-up page.

I was thinking about a refresh page that refreshing every minute..or 10 minutes.. but if they get there and the time is 9:55 AM and the stream starts at 10:00 AM can I code it to countdown from the current time to the desired time , then refresh?
--
Need a Web Developer?


GILXA1226
Premium,MVM
join:2000-12-29
London, OH
clubs:

You might be able to do something with java script. Where you might run into trouble is going across time zones... ie 10:00pm EST != 10:00pm PST. Other than that I wouldn't see too much of a problem.
--
The day I stop learning is the day I die.


Overdrive
Are You Where You Want To Be?
Premium
join:2001-05-31
Waterbury, CT

said by GILXA1226 See Profile:
You might be able to do something with java script. Where you might run into trouble is going across time zones... ie 10:00pm EST != 10:00pm PST. Other than that I wouldn't see too much of a problem.

using the server date/time would eliminate that..

so lets put it together....
--
Need a Web Developer?


Overdrive
Are You Where You Want To Be?
Premium
join:2001-05-31
Waterbury, CT

reply to GILXA1226
ok I have an idea....

I have some Javascript here that will refresh every minute (or if I want every 1 minute 15 seconds.)
code:
<script>
<!--

//enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity.
//Seconds should range from 0 to 59
var limit="1:00"

if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if (curmin!=0)
curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!"
else
curtime=cursec+" seconds left until page refresh!"
window.status=curtime
setTimeout("beginrefresh()",1000)
}
}

window.onload=beginrefresh
//-->
</script>

Now:
var limit="1:00"
all I have to do is figure out the Seconds and minutes difference between the Now() time and the start Time.

So we can first by-pass this by seeing if the Now() time is past the start time or past the end time.
once we figure that out then we can figure out the difference between the 2 times Now() and Start time. then make the difference: var limit="minutes:seconds"
--
Need a Web Developer?


GILXA1226
Premium,MVM
join:2000-12-29
London, OH
clubs:
reply to Overdrive
in my limited knowledge of JavaScript, I don't know if you can get the server time... hmmm. What you could do is get the UTC time and the convert.
--
The day I stop learning is the day I die.


Overdrive
Are You Where You Want To Be?
Premium
join:2001-05-31
Waterbury, CT
I can use ASP script of Now() to get the time.

this doesn't have to be JavaScript.. it can Be in ASP. I just happen to have a refresh script in JavaScript
--
Need a Web Developer?

jthack

join:2001-12-24
Cibolo, TX

 reply to Overdrive
How 'bout a pure ASP solution....

You can use ASP for a possible solution by making use of the ASP-based refresh capability.

Here's what I put together. You can tighten the code up a bit but it should give you a good idea of how to implement:

<%
Option Explicit

'Declare variables
    Dim RefreshTime, TargetTime

'Define target time
     TargetTime = "7:00 PM"

'Calculate difference between current server time
 'and the target time
     RefreshTime = DateDiff("n" , time(), TargetTime)

'Correct for time that's already past by adding another full day (in minutes)
     If RefreshTime < 0 then RefreshTime = RefreshTime + 1440 '(1440 = 24 hours * 60 minutes)

'Convert refresh interval from minutes to seconds
     RefreshTime = RefreshTime * 60

'/Process to "Refresh" the page without META tag
     If RefreshTime <> 0 then '<- don't remove this sanity check
          Response.Expires = 0
          Response.Buffer = True
          Response.Clear
          Response.AddHeader "Refresh", RefreshTime
     Else 'when the page "reloads", set to trigger again 24 hrs from target time
          Response.Expires = 0
          Response.Buffer = True
          Response.Clear
          Response.AddHeader "Refresh", 1440
     End If
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
     <title>ASP Refresh page</title>
</head>

<body>

Target time is <%=TargetTime%>.
<br>
Current time is <%=time()%>.
<p>
This page will refresh in approximately <%= Round((RefreshTime/60), 1) %> minutes.

</body>
</html>

Hope this works for you.

Regards,
Jim


Overdrive
Are You Where You Want To Be?
Premium
join:2001-05-31
Waterbury, CT
Worked! I added it to the Javascript so that it would refresh (cause the asp would not refresh..) but once I added it in to the JaveScript it worked out! Thanks.
--
Need a Web Developer?
Forums » Tech and Talk » OS and Software » Webmasters and DevelopersWhere are MySQL errno codes found? »
« phpbb 2.0.4 to 2.0.6  


Tuesday, 01-Dec 12:05:24 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.republican-creole
page compression OFF
Most commented news this week
· [62] Baltimore To Ban Lazy Cable Installs
· [53] Broadband Killed The Game Console
· [38] Rural Carriers Quickly Embracing Fiber
· [37] Rogers Unveils The ISP Dream Model
· [33] AT&T Top Lobbyist Cicconi Has His Feelings Hurt
· [31] Charter Exits Chapter 11
· [24] Midcontinent Socked With Easement Lawsuit
· [12] ACTA: Global Three Strikes
· [12] Vivendi Agrees, Comcast/NBC Deal Soon
· [5] Telco Exec Gets Broadband In Market Snubbed For Years
Most people now reading
· Heating - my dad gave me this advice... [Home Repair & Improvement]
· Is Microsoft Technet ok to use for my family PC's? [Microsoft Help]
· IMG 1.7 (IMG Updates and Discussion) [Verizon FIOS TV]
· Windows 7 boot manager editing questions [Microsoft Help]
· buying a one way ticket [General Questions]
· [News] Windows 8 Release 2012? [Microsoft Help]
· [Rant] called out sick! [Rants, Raves, and Praise]
· Data Usage Meter Launched [Comcast HSI]
· Prevx says MS Nov 10 patches causing BSOD problems [Security]