Connecting Tech Pros Worldwide Help | Site Map

url forward with query string

 
LinkBack Thread Tools Search this Thread
  #1  
Old December 6th, 2005, 11:25 AM
Adrian
Guest
 
Posts: n/a
Default url forward with query string

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, 11:25 AM
Randy Webb
Guest
 
Posts: n/a
Default 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, 02:15 PM
Dennis Ålund
Guest
 
Posts: n/a
Default 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, 05:55 PM
web.dev
Guest
 
Posts: n/a
Default 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";

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.