duanquan4451 2012-03-10 15:56
浏览 12
已采纳

直接加载显示空白页(PHP)

I currently use an external service for a price comparison unit I have on one of my sites. The way you load the price comparison block is via javascript:

<script type="text/javascript" language="javascript" src="http://www.easycontentunits.com/js_unit.php?ecu_mid=3706&amp;ecu_uid=101734"></script>

If you were to paste the above code into a html page, you would see a block of prices, more info buttons etc. However, if you loaded the source page directly, it shows no content and a completely blank page:

http://www.easycontentunits.com/js_unit.php?ecu_mid=3706&amp;ecu_uid=101734

I am looking to write some code for another site I run and would like it to work like the example above. I.E. when I load an external php page via javascript, it will show it on the webpage. If you followed the link and loaded the external page it would show a blank page.

How would you go about this? Is it some special php code, or a trick with htaccess or similar?

Any help would be greatly appreciated.

  • 写回答

2条回答 默认 最新

  • doutangguan2460 2012-03-10 15:59
    关注

    Most likely what you want is just referer request header check:

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

报告相同问题?

悬赏问题

  • ¥15 Jenkins+k8s部署slave节点offline
  • ¥15 微信小游戏反编译后,出现找不到分包的情况
  • ¥15 如何实现从tello无人机上获取实时传输的视频流,然后将获取的视频通过yolov5进行检测
  • ¥15 WPF使用Canvas绘制矢量图问题
  • ¥15 用三极管设计一个单管共射放大电路
  • ¥15 孟德尔随机化r语言运行问题
  • ¥15 pyinstaller编译的时候出现No module named 'imp'
  • ¥15 nirs_kit中打码怎么看(打码文件是csv格式)
  • ¥15 怎么把多于硬盘空间放到根目录下
  • ¥15 Matlab问题解答有两个问题