Page 1 of 1

ancor links and php GET

Posted: Thu Feb 02, 2006 3:48 am
by php3ch0
Hi everyone

I am using this link on my home page:

Code: Select all

<a href="news.php?article=<?php echo $row_news2['id']; ?>#viewnews"><?php echo $row_news2['title']; ?></a>
This will link to the news story further down located by tag:

Code: Select all

<a name="viewnews"></a>
This works fine for code but when I try to validate the HTML using W3C 4.01 I get this error:
Line 154 column 123: "VIEWNEWS" is not a function name.
How can I do this so that my page is valid?

Posted: Thu Feb 02, 2006 6:52 am
by neophyte
According to the w3c
NAME
This attribute is used to define a named anchor for use as the destination of hypertext links. For example, the following defines an anchor than can be used as the destination of a jump into a description of the Boston area.

The <A NAME="potomac"&gtPotomac river</A> flows into Boston
harbour.

Note: the NAME attribute has been superceded by the ID attribute. User agents should include support for NAME to ensure backwards compatibility with legacy documents produced using previous versions of HTML.
What doctype are you using: I'd stick with transitional loose.