Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0125· OpenAIAi2 WildChat-4.8M (AI2)

http://a.b.com/img.php返回图片时,在领个页面中引用,img.php中如何获取refer,和引用页面的cookie

  1. User
  2. Assistant

    在img.php中,可以通过SERVER[′HTTPREFERER′]来获取引用页面的URL。可以使用_SERVER['HTTP_REFERER']来获取引用页面的URL。可以使用_SERVER['HTTP_COOKIE']来获取引用页面的cookie。以下是一个示例代码:

    $referer = $_SERVER['HTTP_REFERER'];
    $cookie = $_SERVER['HTTP_COOKIE'];
    
    // 输出引用页面的URL和cookie
    echo "Referer: " . $referer . "<br>";
    echo "Cookie: " . $cookie;
    

    请注意,有些浏览器可能不发送引用页面的URL和cookie,因此需要谨慎处理这些信息。

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.