I have this script in PHP, and I want to do this with javascript: header("Location: http://site.com/&subid=" . $_GET["subid"]); so I want to basically do this in javascript. I want to grab the parameter "subid" from the URL and append it to the URL i am redirecting to. it would be something like this: window.location = "http://site.com/&subid="; but what goes here? how do i grab the parameter and append it. thanks!
I think you can do this in two steps. 1. Grab the $_GET['subid'] and write it to a hidden field value. For eg. use a hidden input field and set the value as $_GET['subid'] 2. In the javascript get the document element by id and get the value. Append this value to the window.location. Hope this helps.