Respuesta: llamar a un anclaje desde PHP gracias por vuestras respuestas.
Al final lo hice de esta manera:
Index:
<?php
include ("conex_n.php");
$link=Conectarse();
$result=mysql_query("select * from articulos order by id desc limit 1", $link);
while($row = mysql_fetch_array($result)) { echo "<h2>", $row["titular"],"</h2>", "<a href='noticias.php#noticias1'>[+]</a>"; }
$result=mysql_query("select * from articulos order by id desc limit 1,1", $link);
while($row = mysql_fetch_array($result)) { echo "<h2>", $row["titular"],"</h2>", "<a href='noticias.php#noticias2'>[+]</a>"; }
$result=mysql_query("select * from articulos order by id desc limit 2,2", $link);
while($row = mysql_fetch_array($result)) { echo "<h2>", $row["titular"],"</h2>", "<a href='noticias.php#noticias3'>[+]</a>"; }
mysql_free_result ($result);
mysql_close($link);
?>
Noticias:
<table id="php">
<?php
include ("conex_n.php");
$link=Conectarse();
$result=mysql_query("select * from articulos order by id desc limit 1", $link);
while($row = mysql_fetch_array($result)){
echo "<tr><td class='ancho_fotos'>", $row["imagen"], "</td><td class='ancho'><h2><a name='noticias1' id='noticias1'></a>", $row["titular"],' <strong class=\'fecha\'>', $row["fecha"],'</strong>', "</h2>", "<p>", $row["contenido"], "</p></td></tr>"; }
$result=mysql_query("select * from articulos order by id desc limit 1,1", $link);
while($row = mysql_fetch_array($result)){
echo "<tr><td class='ancho_fotos'>", $row["imagen"], "</td><td class='ancho'><h2><a name='noticias2' id='noticias2'></a>", $row["titular"],' <strong class=\'fecha\'>', $row["fecha"],'</strong>', "</h2>", "<p>", $row["contenido"], "</p></td></tr>"; }
$result=mysql_query("select * from articulos order by id desc limit 2,1000", $link);
while($row = mysql_fetch_array($result)){
echo "<tr><td class='ancho_fotos'>", $row["imagen"], "</td><td class='ancho'><h2><a name='noticias3' id='noticias3'></a>", $row["titular"],' <strong class=\'fecha\'>', $row["fecha"],'</strong>', "</h2>", "<p>", $row["contenido"], "</p></td></tr>"; }
mysql_free_result ($result);
mysql_close($link);
?>
</table>
De esta manera los anclajes se hacen en la primera y la segunda noticia, pero no se como anclar la tercera, que debería poner?
Gracias de nuevo. Un saludo |