Connecting Tech Pros Worldwide Help | Site Map

url forward with query string

  #1  
Old December 6th, 2005, 12:25 PM
Adrian
Guest
 
Posts: n/a
Hi
is it possible (if so how) to do a redirect / url forward with query
string

i.e.
www.test1.com?pram1=a?pram2=b

is forwarded to
www.test2.com?pram1=a?pram2=b

Thanks


  #2  
Old December 6th, 2005, 12:25 PM
Randy Webb
Guest
 
Posts: n/a

re: url forward with query string


Adrian said the following on 12/6/2005 7:15 AM:[color=blue]
> Hi
> is it possible (if so how) to do a redirect / url forward with query
> string[/color]

Yes it is possible.
How? Add the query string to the URL before redirecting.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
  #3  
Old December 6th, 2005, 03:15 PM
Dennis Ålund
Guest
 
Posts: n/a

re: url forward with query string


Use either
header("Location: http://www.test2.com"._SERVER["REQUEST_URI"]);
before anything is written to the document(!) as soon as the first
headers are sent to the browser this won't work.

Or you can have a redirect meta tag in <head> looking like this:
<meta http-equiv='Refresh'
content='0;http://www.test2.com<?=_SERVER["REQUEST_URI"]?>'>
The digit 0 (zero) before the semicolon in 'content' tell the browser
to redirect with 0 seconds delay... which you can change if you want to
display "You are now redirected to test2"

The choice depends a little on when redirection is supposed to happen.

  #4  
Old December 6th, 2005, 06:55 PM
web.dev
Guest
 
Posts: n/a

re: url forward with query string



Adrian wrote:[color=blue]
> Hi
> is it possible (if so how) to do a redirect / url forward with query
> string
>
> i.e.
> www.test1.com?pram1=a?pram2=b
>
> is forwarded to
> www.test2.com?pram1=a?pram2=b
>
> Thanks[/color]

In addition to the solutions above, you can also do the following in
javascript:

location.href = "www.test2.com?pram1=a&pram2=b";

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Download the JAVA , .NET and SQL Server interview with answers Jobs answers 2 September 26th, 2006 02:25 PM
getting variable from query string juglesh answers 10 July 23rd, 2005 05:21 PM
Forward-Back menu bar in frames - numbered set of pages Chris answers 2 July 23rd, 2005 03:48 PM
Capturing Windows Login with ASP dave answers 10 July 19th, 2005 03:09 PM