Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

redirecting using stuff

Status
Not open for further replies.

KryptoS

Programmer
Feb 7, 2001
240
BE
Hi everybody,

I want to redirect my website to somewhere else. I know I can do this with header("location:....");

But now I want to try something else. I also want to fool around with the vars user-agent, referer, accept-language, etc... when I redirect my website to somewhere else. I think it's something with:
$com = "GET $file HTTP/1.1\r\nAccept: */*\r\nAccept-Language: de-ch\r\nAccept-Encoding: gzip, deflate\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)\r\nHost: $server:$port\r\nConnection: Keep-Alive\r\n\r\n";

but how can I redirect it using $com?

can someone help me understanding this stuff?

The One And Only KryptoS
 
That string looks like the HTTP request headers a browser sents to a server. You can't use those headers to direct a browser to another site.

What it looks like you're trying to do is to proxy another site through PHP code. That is certainly doable and doable in more than one way. You could use cURL or fopen or fsockopen, depending on how much browser-like functionality and control you need to have over the process.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top