Jump to content

Creating an if date() type script


gobbly2100

Recommended Posts

Hi there,

 

I am looking to make some script that will hide a div after a certain date.

 

The idea is for advertisers, so if they pay for one month I can enter in the end date that their ad will no longer show.

 

I want to learn PHP so if I can get help on this then that would be great, I want to avoid any pr-made banner scripts etc.

Link to comment
https://forums.phpfreaks.com/topic/192872-creating-an-if-date-type-script/
Share on other sites

use a mysql table... and then you can use a query to select the current advertiser that has bought that time... the table would have the columns "startsOn" and "endsOn", with those values being of the DATETIME format

 

it would be a query similar to:

$todays_ad = mysql_query("SELECT * FROM ads WHERE (NOW() > `startsOn`) AND (NOW() < `endsOn`) LIMIT 1")or die(mysql_error());

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.