Get the parameter from the URL

Advertisement
Hello
I have a problem. I want to know the id that is in the url of an extern site. For example http://www.example.com/employer.jsp?id=1234
Does anybody know how I can get the value 1234 fom the url. I have no idea but it is very important for me.
Please help me,
Henk
Advertisement

Replay

oic. If the document location according to the browser is that URL with the id or whatever, then you could use Javascript to set the value of a hidden form field:
<body ... onload="document.forms['myform'].submit();">
<form name="myform" ... onsubmit="this.url.value=document.location.href; return true;">
<input type="hidden" name="url" />
Of course, that'll submit the form on load, you can change that part if you want.
If the page is in a frameset and you want the top page's location, you can do:
<form name="myform" ... onsubmit="this.url.value=top.document.location.href; return true;">
But, the browser is going to have the location of whatever page it thinks it's viewing, and if it got there by a redirect, it'll show the page it is on, not the page it was redirected from. For forwarding, it'll still think it is on the page that did the forwarding, not the end page. In other words, whatever you see in the brower's location bar should be what you'll get.