Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML Parameters? 1

Status
Not open for further replies.

grega

Programmer
Feb 2, 2000
932
GB
On some links, I see from the status bar that they take the form;


Is this some method of supplying parameters to an HTML page .. if so how (briefly) is this done? I just need something to get me started :)

Greg.
 
grega,

> Is this some method of supplying parameters to an HTML page

Yes

url?paramName=paramValue

The '?' begins the 'Query String'. The string consists of ( name=value) pairs. The string must be UrlEncoded.

-pete
 
and to add some more parameters, separate them with &

url?param1=value1&param2=value2&...

 
Thanks folks ... and how do I use them in the page?

Greg.
 
the easiest way to use them in a page is to use asp..

asp has a querystring object that makes it easy to retrieve the vale for a key.

like:
url is
<%
email = Request.QueryString(&quot;recipient&quot;);
%>

without using asp, its a little more difficult, but you can probably parse the location.href with client side javascript.
 
> you can probably parse the location.href with client side javascript.

Actually the query string is provided in the 'window.location.search' property. It can be parsed using javascript String.split() method.

Hope this helps
-pete
 
Often this is done as a marketing tactic. The query string doesn't actually mean anything to the page it is used on. However, it may indicate where the visitor is coming from (email campaign, banner campaign, etc.). So, in the usage statistics, it will show that page as unique from the same page with a different query string. This way you can track the effectiveness of your advertising without creating seperate pages for each campaign.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top