Results 1 to 4 of 4

Thread: change iframe at different day of the week

  1. #1
    Join Date
    Jan 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question change iframe at different day of the week

    Hello,

    I use now this iframe schript:
    Code:
    <iframe src="www.mysite.com/link.php" width="100%" height="280"> </iframe>
    
    <script language="javascript" type="text/javascript">
    But I need a Iframe script that use a differend url based on the day of the week. Like something:

    Iframe www.mysite.com/monday.php
    Iframe www.mysite.com/tuesday.php
    etc.

    Is this possible?

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,960
    Thanks
    16
    Thanked 305 Times in 304 Posts
    Blog Entries
    11

    Default

    With php you could echo the day of the week in the iframe src to open a page named each weekday;
    Code:
    src="path/to/page/<?php echo date("l");?>.php"
    should output something like;
    Code:
    src="path/to/page/Monday.php"
    See here for date format in php http://www.php.net/manual/en/function.date.php

    Not sure of the equivelant with JavaScript though.
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  3. #3
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,960
    Thanks
    16
    Thanked 305 Times in 304 Posts
    Blog Entries
    11

    Default

    On checking the DD library there's a daily iframe script there: http://www.dynamicdrive.com/dynamici.../dowiframe.htm

    Might be what you need.
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  4. #4
    Join Date
    Jan 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the fast responso!
    This code works great:
    Code:
    src="path/to/page/<?php echo date("l");?>.php"

Similar Threads

  1. change iframe at different time of day
    By OPF Radio in forum JavaScript
    Replies: 6
    Last Post: 12-16-2012, 05:21 AM
  2. change iframe inner A tag urls
    By vinny.benson in forum JavaScript
    Replies: 1
    Last Post: 07-24-2010, 02:06 AM
  3. glossy acc. change iframe to div...?
    By glennnall in forum Dynamic Drive scripts help
    Replies: 10
    Last Post: 04-25-2010, 09:43 PM
  4. Change first day of week (Jason's Date Input Calendar)
    By DjSoundIT in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 11-08-2005, 11:41 PM
  5. Change Whats in the Iframe
    By calum112 in forum HTML
    Replies: 6
    Last Post: 01-07-2005, 10:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •