dongxie1907 2016-07-28 14:45
浏览 15
已采纳

Gmail代理电子邮件中忽略了PHP参数

I am sending a PHP image through email that uses parameters to determine the image to display. This image displays in every email client except Gmail. The reason for this is due to the Google User Content Proxy, which wraps around the link and shows the php file while ignoring the parameters attached to it.

I seem to have the same problem as this question, Problems with tracking pixels and Gmail proxy. Their solution was the following:

I resolved it using https://www.example.com/tracking.php/order_id=1 instead and then on the tracking.php I didn't use $_GET but $_SERVER['REQUEST_URI'] and parsed the /order_id= String.

The problem is I don't understand how to do this.

When I visit the file URL for test.php?par=1, I am able to pull par using $_GET. If I switch the file URL to test.php/par=1, I receive a 404 error.

How do I use /par=1 as my parameter while still accessing test.php first so I can pull the whole url using $_SERVER['REQUEST_URI']?

  • 写回答

2条回答 默认 最新

  • douzhuo5671 2016-07-28 14:52
    关注

    test.php?par=1 is a script named test.php with a query string key of par and value 1.

    If you do not have pathinfo enabled, then test.php/par=1 is a DIRECTORY name test.php, and a non-existent file in that directory named par=1.

    Note that PHP won't parse pathinfo data into $_GET. Only actual ?key=val-type query values are processed for that. You'll have to dig out $_SERVER['PATH_INFO'] and parse it yourself.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵