ancor links and php GET

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
php3ch0
Forum Contributor
Posts: 212
Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK

ancor links and php GET

Post 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?
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post 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.
Post Reply