Welcome to WebmasterWorld Guest from 54.198.243.51

Forum Moderators: open

Message Too Old, No Replies

How to make url changes every 24 hours?

     
9:48 pm on Aug 16, 2017 (gmt 0)

New User

joined:Aug 16, 2017
posts:7
votes: 0


Can someone tell me? I want a link changes url every 24 hours for 7 days with 7 different links, then (last day) i want to start again from beginning. How can i do it? Help...
12:01 am on Aug 17, 2017 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14909
votes: 651


What have you tried so far? It looks like about three lines of php (or other language of your choice) using day-of-week and 24-hour time, but html alone can't do it.

Edit: You'll also need to set caching on the relevant pages to < 1 hour if you've got repeat visitors.
3:31 am on Aug 17, 2017 (gmt 0)

Moderator from US 

WebmasterWorld Administrator keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:12092
votes: 770


You'll also need to set caching on the relevant pages to < 1 hour if you've got repeat visitors.
And then it will take roughly a month for those previously cached pages everyone picked up to drop off.

- - -

Here's a discussion on how to do it with JavaScript or Date Object method: [webmasterworld.com...]

Just substitute the images with URLs
6:49 am on Aug 17, 2017 (gmt 0)

New User

joined:Aug 16, 2017
posts:7
votes: 0


But this my problem. I dont want it with javascript, i want it with html
6:55 am on Aug 17, 2017 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:3844
votes: 212


HTML is not dynamic. You can add javacripts within HTML or php includes and it would display as html in your source, but HTML itself doesn't change once it is saved as a file.

Edited to add: You can manually change the HTML file every 24 hours and upload the new file to overwrite the old file. That gets tiresome pretty quickly.
7:10 am on Aug 17, 2017 (gmt 0)

New User

joined:Aug 16, 2017
posts:7
votes: 0


And how i can make javascript to html?
7:17 am on Aug 17, 2017 (gmt 0)

Moderator from US 

WebmasterWorld Administrator keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:12092
votes: 770


Read the link I provided. You have to do the work. That's how we learn :)
7:18 am on Aug 17, 2017 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:3844
votes: 212


It looks like keyplyr gave you a link to instructions. Maybe try that one?
7:19 am on Aug 17, 2017 (gmt 0)

New User

joined:Aug 16, 2017
posts:7
votes: 0


Ok thx
12:17 pm on Aug 18, 2017 (gmt 0)

New User

joined:Aug 16, 2017
posts:7
votes: 0


Guys i am writing id to num?:

if (linkId && arr[num].link) {
document.getElementById(linkId).href = arr[num].link;
}