Forum Moderators: open

Message Too Old, No Replies

How to make url changes every 24 hours?

         

Teliosmetonma

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

5+ Year Member



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...

lucy24

12:01 am on Aug 17, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



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.

keyplyr

3:31 am on Aug 17, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



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

Teliosmetonma

6:49 am on Aug 17, 2017 (gmt 0)

5+ Year Member



But this my problem. I dont want it with javascript, i want it with html

not2easy

6:55 am on Aug 17, 2017 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



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.

Teliosmetonma

7:10 am on Aug 17, 2017 (gmt 0)

5+ Year Member



And how i can make javascript to html?

keyplyr

7:17 am on Aug 17, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Read the link I provided. You have to do the work. That's how we learn :)

not2easy

7:18 am on Aug 17, 2017 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



It looks like keyplyr gave you a link to instructions. Maybe try that one?

Teliosmetonma

7:19 am on Aug 17, 2017 (gmt 0)

5+ Year Member



Ok thx

Teliosmetonma

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

5+ Year Member



Guys i am writing id to num?:

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