Timed File with PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rehsurq@yahoo.com

    Timed File with PHP

    Greetings all... I was told this would be easy with PHP, but I don't
    know enough about PHP, so I thought I'd ask here...

    I want the main page of my domain to have certain content up until a
    certain date, then different content on a different date. I will be out
    of town and was hoping this could be done automatically. Someone told
    me this would be easy with PHP using the "if else" statements, a
    switch, and using the date() functions.

    Can anyone help if this is easy, or let me know if this isn't?

    Regards

  • NC

    #2
    Re: Timed File with PHP

    rehs...@yahoo.c om wrote:[color=blue]
    >
    > I want the main page of my domain to have certain content up until
    > a certain date, then different content on a different date.[/color]

    Easy indeed:

    $certain_date = 'May 15, 2005';
    $certain_time = strtotime($cert ain_date);
    if (time() > $certain_time) {
    echo 'New Content';
    } else {
    echo 'Old Content';
    }

    Cheers,
    NC

    Comment

    • rehsurq@yahoo.com

      #3
      Re: Timed File with PHP

      Wow, that's really simple.

      Nevertheless, THANK YOU for supplying it!!!

      Comment

      Working...