|
|
|
ขอโค๊ดที่สามารถเก็บ url หลังการ redirect หน่อยครับ |
|
|
|
|
|
|
|
Code (PHP)
$_SERVER["HTTP_REFERER"];
แบบนี้พอได้ไหม๊ครับ
|
|
|
|
|
Date :
2017-04-13 14:55:20 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไปงมมาให้แล้วครับ
Code (PHP)
$urls = 'https://goo.gl/bLn8tC';
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $urls);
$out = curl_exec($ch);
// line endings is the wonkiest piece of this whole thing
$out = str_replace("\r", "", $out);
// only look at the headers
$headers_end = strpos($out, "\n\n");
if($headers_end !== false) {
$out = substr($out, 0, $headers_end);
}
$headers = explode("\n", $out);
foreach($headers as $header) {
if(substr($header, 0, 10) == "Location: "){
$target = substr($header, 10);
echo $target;
}
}
|
|
|
|
|
Date :
2017-04-13 21:45:17 |
By :
pxmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|