Linkje in php

Status
Niet open voor verdere reacties.

Wijnands

Gebruiker
Lid geworden
6 jul 2004
Berichten
635
Beste hm'ers,

Ik heb de volgende code:

PHP:
<html>
<body bgcolor="3a444f" text="ffffff" alink="ffffff" vlink="ffffff" link="ffffff">
Laatste nieuws:
<hr>
</body>
</html>
<?php 
include("db.php"); 

$toon_query = mysql_query("SELECT * FROM nieuws ORDER BY id DESC LIMIT 5") or die (mysql_error()); 

while($toon = mysql_fetch_object($toon_query)) { 
 
echo "<TH>$toon->datum  </TH><TR><br> 
<TD>$toon->titel</a></TD><TR><hr><br>"; 
}
?>
<html>


<a href="toevoegen.php" target="hoofd">Nieuws Toevoegen</a>

</html>

En nu wil ik graag dat
PHP:
<TD>$toon->titel</a></TD><TR><hr><br>
klikbaar wordt door middel van:
PHP:
<a href="lees.php?id=<? echo $id; ?>" target="hoofd">Bovenstaande code</a>

Maar hoe?
 
Sorry mensen maar ik heb het antwoord al gevonden.:thumb:
 
misschien handig om uit te leggen hoe het nu wel moet, zodat anderen iets aan dit topic kunnen hebben ;)
 
Ok, het lukt zowiezo niet :D
Ik heb nu de volgende code:
PHP:
<html>
<body bgcolor="3a444f" text="ffffff" alink="ffffff" vlink="ffffff" link="ffffff">
Laatste nieuws:
<hr>
</body>
</html>
<?php


 
include("db.php"); 

$toon_query = mysql_query("SELECT * FROM nieuws ORDER BY id DESC LIMIT 5") or die (mysql_error()); 

while($toon = mysql_fetch_object($toon_query)) { 
 
$id = $_GET['id'];

echo '<TH>'.$id.' </TH>';
echo '<TH>'.$toon->datum.'  </TH><TR><br>'; 
echo '<TD><a href="lees.php?id='.$id.'">'.$toon->titel.'</a></TD><TR><hr><br>';  
}
?>

<html>


<a href="login.html" target="hoofd">Nieuws Toevoegen</a>

</html>

Verholpen!
Nieuwe broncode:

PHP:
<html>
<body bgcolor="3a444f" text="ffffff" alink="ffffff" vlink="ffffff" link="ffffff">
Laatste nieuws:
<hr>
</body>
</html>
<?php


 
include("db.php"); 

$toon_query = mysql_query("SELECT * FROM nieuws ORDER BY id DESC LIMIT 5") or die (mysql_error()); 

while($toon = mysql_fetch_object($toon_query)) { 
 
$id = $toon->id; 

echo '<TH>'.$id.' </TH>';
echo '<TH>'.$toon->datum.'  </TH><TR><br>'; 
echo '<TD><a href="lees.php?id='.$id.'">'.$toon->titel.'</a></TD><TR><hr><br>';  
}
?>

<html>


<a href="login.html" target="hoofd">Nieuws Toevoegen</a>

</html>
 
Laatst bewerkt:
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan