I tried everything, I’ll give all the code, should you require something more just tell me
Before the <head>
[code=php]<?php
if (empty($page)) {
$page = 0;
}
if (!empty($datesubmit)) {
if (empty($date)){
$date = $year.”-“.$month.”-“.$day;
}
}else{
$date = date(“Y-m-d”);
}
require(“NewsSql.inc.php”);
$db = new NewsSQL($DBName);
$searchresult = $db->getnewsbydate($page,$front_searchresultrecord,$date);
$PHP_SELF = $_SERVER[“PHP_SELF”];
?>
archive.php:
[code=php]<?php
print “$front_choosedate”;
dispselectdate();
?>
<?php
if (!empty($searchresult)) {
while ( list($key,$val)=each($searchresult) ) {
$title = stripslashes($val[“title”]);
$newsid = stripslashes($val[“newsid”]);
print “<a href=”news.php?newsid=$newsid” class=”en_b”>$title</a><br>”;
}
}
?><br>
<?php
$pagenext = $page+1;
$result1 = $db->getnewsbydate($pagenext,$front_searchresultrecord,$date);
if ($page!=0)
{
$pagepre = $page-1;
print “<a href=”$PHP_SELF?page=$pagepre&date=$date&datesubmit=$datesubmit”
class=”en_b”>$front_previouspage</a> ”;
}
if (!empty($result1))
{
print “<a href=”$PHP_SELF?page=$pagenext&date=$date&datesubmit=$datesubmit”
class=”en_b”>$front_nextpage</a>”;
}
?>
the dispselectdate()
[code=php]
function dispselectdate()
{
global $front_searchsubmit;
$nowtimestamp = time();
$selecttimestamp = $nowtimestamp-86400;
$selectyear = date(“Y”,$selecttimestamp);
$selectmonth = date(“m”,$selecttimestamp);
$selectday = date(“j”,$selecttimestamp);
print “<form action=”$PHP_SELF” method=”POST”>
<select name=”year”>”;
for ($tempyear=2009;$tempyear<=2009;$tempyear++){
if ($tempyear==$selectyear){
print “<option value=”$tempyear” selected>$tempyear</option>”;
}else{
print “<option value=”$tempyear”>$tempyear</option>”;
}
}
print “</select>  Year  ”;
print “<select name=”month”>”;
for ($tempmonth=1;$tempmonth<=12;$tempmonth++){
if ($tempmonth==$selectmonth){
if ($tempmonth<10){
$tempmonth1 = “0”.”$tempmonth”;
}else{
$tempmonth1 = $tempmonth;
}
print “<option value=”$tempmonth1″ selected>$tempmonth1</option>”;
}else{
if ($tempmonth<10){
$tempmonth1 = “0”.”$tempmonth”;
}else{
$tempmonth1 = $tempmonth;
}
print “<option value=”$tempmonth1″>$tempmonth1</option>”;
}
}
print “</select>  Month  ”;
print “<select name=”day”>”;
for ($tempday=1;$tempday<=31;$tempday++){
if ($tempday==$selectday){
if ($tempday<10){
$tempday1 = “0”.”$tempday”;
}else{
$tempday1 = $tempday;
}
print “<option value=”$tempday1″ selected>$tempday1</option>”;
}else{
if ($tempday<10){
$tempday1 = “0”.”$tempday”;
}else{
$tempday1 = $tempday;
}
print “<option value=”$tempday1″>$tempday1</option>”;
}
}
print “<select>  Day  ”;
print “<input type=”submit” name=”datesubmit” value=”$front_searchsubmit”>
</form>”;
}
?>
The problem is, when put in a date and press search, the date form changes back to the 1st of january 2009 and outputs nothing.