I have the following code:
PHP Code:
// SHOW ARCHIVE LINK
if ($usearchives == 1 AND !isset($page)) {
$archivelink = "$PHP_SELF?page=archives";
eval("\$outputarchive = \"$archive\";");
echo("$outputarchive"); }
}
// -------------- DISPLAY ARCHIVE LIST --------------
if($page == "archives") {
echo("<div align='left'><img src="../images/new_archives2.gif"></div><P>");
echo("<h5>$text_archives</h5>");
$sql = "SELECT UNIX_TIMESTAMP(date) as formatted_date FROM ashnews_news WHERE $catlist GROUP BY YEAR(date), MONTH(date) ORDER BY date DESC";
$sql_result = mysql_query($sql, $connection) or die ("$text_noquery - 7");
while ($row = mysql_fetch_array($sql_result)) {
$temp = $row['formatted_date'];
$m = date("m", $temp);
$month = date("F", $temp);
$year = date("Y", $temp);
$archivelink = "$PHP_SELF?page=showmonth&m=$m&y=$year";
eval("\$outputarchivelist = \"$archivelist\";");
echo("$outputarchivelist");
now I want to be able to use the archives list in a different template other than self. So I created a new php file called archives1.php and changed the following on this code:
PHP Code:
$archivelink = "archive1.php?page=archives";
and
PHP Code:
$archivelink = "archive1.php?page=showmonth&m=$m&y=$year";
but that doesn't seem to work. I get an internal error message. can somebody help? what code do I use in the archive.php file to grab the variables and display the data?
Bookmarks