开发者

Http php proxy server

how to recover a a url along with the message which it sends form a client system in the proxy server.there is any command to recover the url and take the message out of the url in the proxy server before forwarding t开发者_如何学Pythonhe url to Internet.

For Example:

http://companion_proxy/ocl.cgi?req=cnc_cmd;target=12;action=setchannel;channel=34

this is the url is typed in address bar,then how to recover the above url and the message such as

target=12,action=setchannel,channel=34,req=cnc_cmd from the url.

I have to extract the information from url in proxy server before the proxy server is forwarding the url to internet. Thanks in advance.


The $_SERVER variable holds the information you need:

http://php.net/manual/en/reserved.variables.server.php

Specifically:

$_SERVER['SERVER_NAME']

and

$_SERVER['REQUEST_URI']

and

$_SERVER['QUERY_STRING']


$uri = $_SERVER["REQUEST_URI"];
echo str_replace("/ocl.cgi?req=cnc_cmd;", "", $uri);


Go for Below code you can debug and find what you want...

echo "<pre>";
print_r($_SERVER);
echo "</pre>";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜