dongxie1907 2016-07-28 14:45
浏览 15


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 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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?



  • ¥30 sort cuteSV.vcf by bcftools用IGV可视化出现报错
  • ¥100 SOS!对STK中导出的天体图像进行质心提取有没有人做过啊
  • ¥15 python 欧式距离
  • ¥15 运行qteasy报错
  • ¥15 遗传算法解决有工序顺序约束的大规模FJSP问题
  • ¥15 企业消防水炮塔设计方案
  • ¥20 WORKBENCH网格划分
  • ¥60 急招师兄远程解决下载NPCAP的BUG!
  • ¥15 关于#51单片机#的问题:51单片机LM1602的数据只能显示一个字符,在使用矩形键盘送数据的时候不能显示出来而是在显示初始位置上,达不到密码锁的效果
  • ¥15 求旧版本ns-2软件