Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,157,992 members, 7,835,330 topics. Date: Tuesday, 21 May 2024 at 08:46 AM

Changeco's Posts

Nairaland Forum / Changeco's Profile / Changeco's Posts

(1) (of 1 pages)

Webmasters / Re: Writing A Time Based Expiration Script Or Function Using Php And Mysql by changeco: 6:17pm On Feb 25, 2009
I have a similar coding issue,  However, It seems far less complicated,  I have a recordset that returns the startdate and enddate. I want to check the startdate against the end date. If the users enddate has passed, redirect them to an "expired.php" page, if not, continue; in that same function if the startdate is after the current date redirect them to a "notyet.php" page that displays their startdate,

The expired page works, which is strange the notyet page doesn't,

Here's what I have so far,

<?php
$startdate = $row_product['startdate'];
$enddate = $row_product['enddate'];
$todays_date = date("Y-m-d"wink;

if ($enddate <= $todays_date) {
header('Location: expired.php');
}
elseif ($startdate < $todays_date){
header('Location: notyet.php');
}else {
}
?>


Any help would be a better than perfect!

(1) (of 1 pages)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 5
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.