| 
	
 | 
 Posted by elia on 04/18/06 10:45 
Hello, 
 
I get a database for « News » on Internet. 
Side Admin, I would like a form to know witch "News" are Online or 
not. 
 
 
In my database mysql I get : 
 
Date_start 
and 
Date_end 
 
Outside this date, the « News » are unvisible. 
 
 
In my form I put a checkbox « Off_line » 
 
If it's check, all the news outside Date_start 
And Date_end  must be visible. 
 
 
I tryed like this 
 
In Head : 
<?php 
if (isset($HTTP_GET_VARS["date_off"])) 
{ 
$ date_off =$HTTP_GET_VARS["date_off"]; 
} 
else 
{ 
$ date_off =0; 
} 
?> 
 
In my form for checkbox : 
<input <?php if  ("CURRENT_DATE NOT BETWEEN $row_R_news['date_start'] 
AND $row_R_news['date_end'] ",1) {echo "checked=\"checked\"";} ?> 
name=" date_off " type="checkbox" id=" date_off " value="1"> 
 
 
For my request sql : 
SELECT t_news.* 
FROM t_news 
WHERE  $date_off 
 
Thanks to help me, pascal
 
[Back to original message] 
 |