如果根据url判断网页内容的显示

WBOY
Release: 2016-06-23 14:23:46
Original
1136 people have browsed it

url php

<div>						<?php /*?><p>让天下没有烦心的装修</p>                        						<span id="current_city"><?php echo $default_city_rs["cn"]?"".$default_city_rs["cn"]."":"总站";?></span> <a href="###" onclick="showcity();" class="switch">[切换城市]</a><?php */?>						<img     style="max-width:90%" src="../img/yangzi.jpg" / alt="如果根据url判断网页内容的显示" >            					</div>
Copy after login


如果url显示是dz.xxxx.com 显示如果根据url判断网页内容的显示 否则显示上面的
<p>让天下没有烦心的装修</p>                        						<span id="current_city"><?php echo $default_city_rs["cn"]?"".$default_city_rs["cn"]."":"总站";?></span> <a href="###" onclick="showcity();" class="switch">[切换城市]</a>
Copy after login


求指导,求代码!感谢!!!!

回复讨论(解决方案)

如果url显示是dz.xxxx.com  显示如果根据url判断网页内容的显示 否则显示上面的
你这句话有点问题吧 上面本来就显示了如果根据url判断网页内容的显示 
你用这个判断吧
获取完整的url为:$url='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
if($url=='dz.xxxx.com'){
//url显示是dz.xxxx.com要执行的代码块
}else{
//url不是dz.xxxx.com要执行的代码块
}



希望能帮到你

谢谢,弄好了

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!