url forward with query string

R

Randy Webb

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

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

Dennis Ålund

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top