不同的网站标志为不同的输入(屏蔽)网址



一些帮助会很棒!

ABC1.com显示图像ABC1。当域ABC2.com转发时,如何使其显示图像ABC2,并使用屏蔽到ABC1.com?

基本上,网站应该根据其来源的域名来改变其品牌。

我会使用referr来设置一个变量,该变量作为文件的基本名称。类似于:

 <?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'];
?>

相关内容

  • 没有找到相关文章

最新更新