【发布时间】:2014-10-07 20:18:01
【问题描述】:
一些帮助会很棒!
域 ABC1.com 显示图像 ABC1。当域 ABC2.com forwards 带有 masking 时,我怎样才能使它显示 image ABC2 ABC1.com?
基本上,网站应根据其起源的域名更改其品牌。
【问题讨论】:
标签: php dns image-masking
一些帮助会很棒!
域 ABC1.com 显示图像 ABC1。当域 ABC2.com forwards 带有 masking 时,我怎样才能使它显示 image ABC2 ABC1.com?
基本上,网站应根据其起源的域名更改其品牌。
【问题讨论】:
标签: php dns image-masking
我会使用引荐来源网址来设置一个变量,该变量被回显为文件的基本名称。比如:
<?php
//check to see if referrer is set
if(isset($_SERVER['HTTP_REFERER'])){
//if referrer is set, evaluate to see if it matches a specified site. plug in desired where somewebsite appears in quotes in the following line
if($_SERVER['HTTP_REFERER'] == 'somewebsite'){
//set baseName for first website
$baseName = "base1";
}
else if($_SERVER['HTTP_REFERER'] == 'somewebsite'){
//set baseName for second website
$baseName = "base2";
}
//evaluate as many websites in this manner as you'd like
//set baseName value if http referrer does not match any specified site
else{
$baseName = "basenone";
}
}
//set baseName value if no HTTP_REFERER
else{
$baseName = "basenotset";
}
//echo baseName as first part of logo filename. note that for this solution to work, you will have to name your logo files base1_logo.jpg, base2_logo, ... $basenone_logo
echo "<img src=\"".$baseName."_logo.jpg.\">";
echo '<a href="test.php">TEST</a>';
echo "<p>".$_SERVER['HTTP_REFERER'];
?>
【讨论】: