RE: [PHP] Display after a certain date

2003-09-05 Thread Jay Blanchard
[snip]
Anyone have a quick fix for a part of an html page that I do not want to
display until after October 1st, and not after October 31st ?
[/snip]

You must have missed the conditionals part of the manual

?php // untested

$display_start = 2003-10-01;
$display_end = 2003-10-31;
if((date(Y-m-d) = $display_start)  (date(Y-m-d) =
$display_end)){
print($stuff);
}
?

Now, if you are getting the stuff out of the database you can select
according to date if you have start and end dates as columns (as would
be in most CMS databases);

SELECT paragraph 
FROM tblArticles
WHERE CURRENT_DATE() BETWEEN '2003-10-01' AND '2003-10-31'

HTH and Have a pleasant day.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Display after a certain date

2003-09-05 Thread John Taylor-Johnston
Jay,
I should have though of that. Thanks.

Jay Blanchard [EMAIL PROTECTED] wrote:
?php
$display_start = 2003-10-01;
$display_end = 2003-10-31;
if((date(Y-m-d) = $display_start)  (date(Y-m-d) =
$display_end)){
print($stuff);
}
?

Cesar: Is your server is set up correctly? In your httpd.conf file, add .html you can 
use php in html files:

IfModule mod_php4.c
AddType application/x-httpd-php .php .php4 .php3 .phtml .htm .html
AddType application/x-httpd-php-source .phps
/IfModule
IfModule mod_php3.c
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
/IfModule
IfModule mod_php.c
AddType application/x-httpd-php .phtml
/IfModule

Cesar Aracena wrote:

 If you could just change the file extension to .php to be accord to this
 forum...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Display after a certain date

2003-09-04 Thread John Taylor-Johnston
Anyone have a quick fix for a part of an html page that I do not want to display until 
after October 1st, and not after October 31st ?
J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php