MisterIKS: Dynamischer Verweis innerhalb der Seite

Beitrag lesen

Ich habe schon öfters mir Ankern gearbeitet, ich kann mir vorstellen, dass es vielleicht daran liegt, dass ich die Anker dynamisch mit php erzeuge.

Ich benutze die Seite in XAMPP, ich geb euch einfach nur den Code:

  
<table>  
			  
<?php  
			  
$abfragen = mysql_query("SELECT * FROM mph_portfolio ORDER BY id DESC");  
$counter = 0;  
$rowcount = 0;  
			  
while($row = mysql_fetch_object($abfragen))  
{  
	$counter ++;  
	if($counter == 1) {  
		$rowcount ++;  
		echo("<a name=\"".$rowcount."\"><tr style='vertical-align:top;'>");  
	}  
	?>  
				  
	<td>  
				  
	<?php  
	if($_GET["id"] == $row->id)  
	{ ?>  
				  
		<div style="width:285px;">  
		<div id="pf_oben"><img src="<?php echo($row->image); ?>" /><a href="<?php echo($row->link); ?>" target="_blank" id="headline" style="margin-top:10px; width:243px; text-align:center;"><?php echo($row->name); ?></a></div>  
		<div id="pf_mitte"><?php echo($row->text); ?></div>  
		<div id="pf_unten"></div>  
		</div>  
					  
	<?php } else { ?>  
				  
		<div style="width:285px; height:285px;">  
		<div id="pf_oben"><img src="<?php echo($row->image); ?>" /><a href="<?php echo($row->link); ?>" target="_blank" id="headline" style="margin-top:10px; width:243px; text-align:center;"><?php echo($row->name); ?></a></div>  
		<div id="pf_links"><?php echo($row->preview); ?></div>  
		<a href="index.php?page=portfolio&id=<?php echo($row->id); ?>#<?php echo($rowcount); ?>" id="pf_button"></a>  
		</div>  
								  
	<?php } ?>  
				  
	</td>  
				  
	<?php  
	if($counter == 3) {  
		echo("</tr></a>");  
		$counter = 0;  
	}  
}  
?>  
		  
</table>