tags:

views:

46

answers:

2

This is a simple HTML question, made more embarrassing (and harder to google) since I don't know the vocabulary.

I want to make a link that put additional information after the url:

www.example.com/page.html?variable=yes&page=5

How do I do this with a link? I know how to do it with a form.

+3  A: 
<a href='http://www.example.com/page.html?variable=yes&amp;amp;page=5'&gt;Click me!</a>

I suspect this isn't what you were after...

Ned Batchelder
Well . . . now I feel even more foolish.
FarmBoy
+1  A: 

The additional information after the question mark is called the query string. You can include the query string directly in your link:

<a href="http://www.example.com/page.html?variable=yes&amp;amp;page=5"&gt;example&lt;/a&gt;
Bruce Alderman
Ampersand should be escaped to be valid in an HTML attribute. You can get away with the mistake in browsers, but only for as long as the next parameter doesn't match an entity name.
bobince
@bobince: Thanks, I fixed it.
Bruce Alderman