Reputation: 3418
Can somebody explain how does it matter to pass different parameters in a url,
e-g
1: www.domain.com/folder1/folder2/file.html?param=9?val=ty5?test
2: www.domain.com/folder1/folder2/file.html#param=93#val=t5y5?test=9
3: www.domain.com/folder1/folder2/file.html¶m=9?val=ty5&test=90#poiu
Basically I want to know what do these three characters (#, &, ?)
do in the url. I have seen them most of the times? can I use some thing other than that
e-g: www.domain.com/folder1/folder2/file.html*param=9_val+ty5@test
Upvotes: 2
Views: 2559
Reputation: 1
Upvotes: -1
Reputation: 24526
?
indicates the start of the query string
&
separates key value pairs of the querystring
#
indicates an anchor. Here's more on anchor links.
Note that all three of your urls are incorrect.
Valid url:
http://domain/path/file?name=value&name=value#anc
I notice you've edited your question with an additional question
can I use some thing other than that e-g: www.domain.com/folder1/folder2/file.html*param=9_val+ty5@test
You can use whatever you like in the part of the querystring or anchor as long as it is url encoded.
Upvotes: 11
Reputation: 709
This Wikipedia article goes in to the detail and gives some good examples.
?
indicates the start of the query&
separates the parameters in the query#
identifies a fragment in the HTML
resource to be rendered. It's often used to identify which but if the page the browser should ensure is in view eg a heading etcUpvotes: 3
Reputation: 6123
? represents that the URL contains QueryString values. & is used to for multiple querystring values. Example
www.abc.com/page?id=abc&pwd=def
and # is new for me I first time saw it.
Upvotes: 0