ik ben nou bezig met een script om active topics uit het forum in de index te plaatsen, maar mijn script werkt alleen niet mee.. Zou jullie me misschien kunnen vertellen wat er niet klopt?
script:
<?php
/*****************************************************************************
* test.php *
*****************************************************************************/
?>
<html>
<head>
<title>Resultaten van alle topics!</title>
</head>
<body bgcolor="#336699">
<center>
<table borderColor="#08315a" cellSpacing="0" width="752" bgColor="#7394b5" border="1">
<tr>
<td>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px" align="center"><font face="Verdana" size="2" color="#FFFFFF">HIER
VIND JE DE active topics!</font></p>
</td>
</tr>
</table>
</center>
<br>
<?php
$ServerPath = "config.php";
$ServerURL = "http://localhost/";
require($ServerPath);
$db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("here we die at connection");
@mysql_select_db("$dbname",$db) or die("here we die");
$sql = "SELECT * FROM post";
$resultaat = mysql_query("SELECT post, threadid FROM topics ORDER BY last_post LIMIT 0, 1",$db);
?>
<?php
?>
<?php
while ($record = mysql_fetch_object($resultaat))
if($r = mysql_query($sql, $db)) {
echo "<center><table width=\"752\" border=\"1\" bordercolor=\"08315a\" bgcolor=\"#7394B5\" cellspacing=0>";
while($m = mysql_fetch_array($r)) {
$j = stripslashes($m[title]);
$k = substr($j, 0, 100) . "...";
echo "<tr><td><p style=\"word-spacing: 0; margin-top: 0; margin-bottom: 0\">
<font face=\"Verdana\" size=\"2\"><a href=\"$ServerURL/showthread.php[$resultaat]\" target=\"_blank\">$k</a></p></td></tr>
";
}
}
$result = mysql_query("SELECT * FROM post ORDER BY id DESC LIMIT 0, 1",$db);
while ($myrow = mysql_fetch_array($result))
echo "</font></table></center>";
?>
<br>
<center>
<table borderColor="#08315a" cellSpacing="0" width="752" bgColor="#7394b5" border="1">
<tr>
<td>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px" align="center"><font face="Verdana" size="2" color="#FFFFFF"></font></p>
</td>
</tr>
</table>
</center>
</body>
</html>
script:
<?php
/*****************************************************************************
* test.php *
*****************************************************************************/
?>
<html>
<head>
<title>Resultaten van alle topics!</title>
</head>
<body bgcolor="#336699">
<center>
<table borderColor="#08315a" cellSpacing="0" width="752" bgColor="#7394b5" border="1">
<tr>
<td>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px" align="center"><font face="Verdana" size="2" color="#FFFFFF">HIER
VIND JE DE active topics!</font></p>
</td>
</tr>
</table>
</center>
<br>
<?php
$ServerPath = "config.php";
$ServerURL = "http://localhost/";
require($ServerPath);
$db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("here we die at connection");
@mysql_select_db("$dbname",$db) or die("here we die");
$sql = "SELECT * FROM post";
$resultaat = mysql_query("SELECT post, threadid FROM topics ORDER BY last_post LIMIT 0, 1",$db);
?>
<?php
?>
<?php
while ($record = mysql_fetch_object($resultaat))
if($r = mysql_query($sql, $db)) {
echo "<center><table width=\"752\" border=\"1\" bordercolor=\"08315a\" bgcolor=\"#7394B5\" cellspacing=0>";
while($m = mysql_fetch_array($r)) {
$j = stripslashes($m[title]);
$k = substr($j, 0, 100) . "...";
echo "<tr><td><p style=\"word-spacing: 0; margin-top: 0; margin-bottom: 0\">
<font face=\"Verdana\" size=\"2\"><a href=\"$ServerURL/showthread.php[$resultaat]\" target=\"_blank\">$k</a></p></td></tr>
";
}
}
$result = mysql_query("SELECT * FROM post ORDER BY id DESC LIMIT 0, 1",$db);
while ($myrow = mysql_fetch_array($result))
echo "</font></table></center>";
?>
<br>
<center>
<table borderColor="#08315a" cellSpacing="0" width="752" bgColor="#7394b5" border="1">
<tr>
<td>
<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px" align="center"><font face="Verdana" size="2" color="#FFFFFF"></font></p>
</td>
</tr>
</table>
</center>
</body>
</html>
De enige echte....