I want to link an anchor tag from one page to another. The second of which is a view all page that pulls data from the database. When run the code below, the second page is loaded but doesn’t move to the tag. Here is the code for the 1st page:
echo "<h2>$dd. $info and ID is
**<a href=\"v.php#".$row['id']."\">$id</a>**</h2><hr />";
Here is the code for the page it should point to:
while($row = mysql_fetch_array( $result )) {
**$ggg = $row['id'];**
echo "<tr>";
echo '<td><a href="delete.php?id=' . $row['id'] . '"><input type="button" value="Delete"></a></td>**<a name="$ggg"></a>**';
echo '<td>' . $row['id'] . '</td>';
echo '<td>' . $row['info'] . '</td>';
echo "</tr>";
}
Your php variable
$gggwill not be parsed as it is being echo’ed inside single quotes''so your<a>anchor will not be correct-Change it to –
so it is now –