<?php
$Zeilen_pro_Seite = 2;
if (!isset($Anfangsposition)) {
$Anfangsposition = 0;
}
?>
<?php
$pfad = "img/"; // Pfad angeben
$anzdate = date('Y-m-d');
// -------------------- Anzahl der Anzeigen zählen
$count = mysql_query("SELECT COUNT(*) as gesamtanz from artikel WHERE drp3id = $anz AND datumbis > $anzdate");
$anzahl = mysql_fetch_array ($count);
?>
<table style="border-width: 1px; border-color: #000000; border-style: solid;" cellspacing="1" cellpadding="1" class="maintext">
<tr><td bgcolor="#ffba54" height="20" colspan="2">
<b>Übersicht der aktuellen Anzeigen</b> (<?php echo $anzahl[gesamtanz]; ?>)</td></tr>
<?php
// -------------------- Ausgabe der Anzeigen
$sql = mysql_query("SELECT * from artikel WHERE drp3id = $anz AND datumbis > $anzdate AND status = 1 ORDER by datum DESC limit $Anfangsposition,$Zeilen_pro_Seite");
while ($result = mysql_fetch_array($sql)) {
?>
<tr>
<td bgcolor="#f3f3f3" valign="top"><b><?php echo $result[titel]; ?></b></td>
<td bgcolor="#f3f3f3" valign="top" align="right"><?php echo $result[datum]; ?></td>
</tr><tr>
<?php
if ($result[image] == ""){ ?>
<td bgcolor="#f3f3f3" valign="top">Kein Bild</td>
<?php } else { ?>
<td bgcolor="#f3f3f3" valign="top"><?php echo "<img src=\"$pfad/$result[image]\" width=60 border=1>"; ?></td>
<?php } ?>
<td bgcolor="#f3f3f3" valign="top" width="500"><?php echo $result[text]; ?></td>
</tr><tr>
<td bgcolor="#f3f3f3" valign="top" colspan="2">Email an: <a href="mailto:<?php echo $result[email]; ?>"><?php echo $result[email]; ?></a> | Telefon: <?php echo $result[telefon]; ?> | PLZ: <?php echo $result[plz]; ?></td></tr>
<tr><td bgcolor="#ffffff" colspan="2"><img src="gif/td-trans.gif" width="1" height="1"></td></tr>
<?php } ?>
</table>
<?php
$Anzahl = $anzahl[gesamtanz];
if($Anzahl>$Zeilen_pro_Seite) {
$Seiten=intval($Anzahl/$Zeilen_pro_Seite);
if($Anzahl%$Zeilen_pro_Seite) {
$Seiten++;
}
}
for ($i=1;$i<=$Seiten;$i++) {
$fwd=($i-1)*$Zeilen_pro_Seite;
echo "<a href=\"anzuser.php?Anfangsposition=$fwd\">$i</a>";
}
?>
Also die Errechnung der angezeigten Datensätze funktioniert einwandfrei.
Wenn ich aber jetzt auf den Link klicke, der mir mich eine Seite vorwärts bringen sollte, bekomme ich nur Fehlermeldungen 
							
						
					$Zeilen_pro_Seite = 2;
if (!isset($Anfangsposition)) {
$Anfangsposition = 0;
}
?>
<?php
$pfad = "img/"; // Pfad angeben
$anzdate = date('Y-m-d');
// -------------------- Anzahl der Anzeigen zählen
$count = mysql_query("SELECT COUNT(*) as gesamtanz from artikel WHERE drp3id = $anz AND datumbis > $anzdate");
$anzahl = mysql_fetch_array ($count);
?>
<table style="border-width: 1px; border-color: #000000; border-style: solid;" cellspacing="1" cellpadding="1" class="maintext">
<tr><td bgcolor="#ffba54" height="20" colspan="2">
<b>Übersicht der aktuellen Anzeigen</b> (<?php echo $anzahl[gesamtanz]; ?>)</td></tr>
<?php
// -------------------- Ausgabe der Anzeigen
$sql = mysql_query("SELECT * from artikel WHERE drp3id = $anz AND datumbis > $anzdate AND status = 1 ORDER by datum DESC limit $Anfangsposition,$Zeilen_pro_Seite");
while ($result = mysql_fetch_array($sql)) {
?>
<tr>
<td bgcolor="#f3f3f3" valign="top"><b><?php echo $result[titel]; ?></b></td>
<td bgcolor="#f3f3f3" valign="top" align="right"><?php echo $result[datum]; ?></td>
</tr><tr>
<?php
if ($result[image] == ""){ ?>
<td bgcolor="#f3f3f3" valign="top">Kein Bild</td>
<?php } else { ?>
<td bgcolor="#f3f3f3" valign="top"><?php echo "<img src=\"$pfad/$result[image]\" width=60 border=1>"; ?></td>
<?php } ?>
<td bgcolor="#f3f3f3" valign="top" width="500"><?php echo $result[text]; ?></td>
</tr><tr>
<td bgcolor="#f3f3f3" valign="top" colspan="2">Email an: <a href="mailto:<?php echo $result[email]; ?>"><?php echo $result[email]; ?></a> | Telefon: <?php echo $result[telefon]; ?> | PLZ: <?php echo $result[plz]; ?></td></tr>
<tr><td bgcolor="#ffffff" colspan="2"><img src="gif/td-trans.gif" width="1" height="1"></td></tr>
<?php } ?>
</table>
<?php
$Anzahl = $anzahl[gesamtanz];
if($Anzahl>$Zeilen_pro_Seite) {
$Seiten=intval($Anzahl/$Zeilen_pro_Seite);
if($Anzahl%$Zeilen_pro_Seite) {
$Seiten++;
}
}
for ($i=1;$i<=$Seiten;$i++) {
$fwd=($i-1)*$Zeilen_pro_Seite;
echo "<a href=\"anzuser.php?Anfangsposition=$fwd\">$i</a>";
}
?>
Also die Errechnung der angezeigten Datensätze funktioniert einwandfrei.
Wenn ich aber jetzt auf den Link klicke, der mir mich eine Seite vorwärts bringen sollte, bekomme ich nur Fehlermeldungen
 
							
						 
          
 Moderator
 Moderator
Comment