如果此页显示此其他显示此 [英] If this Page Show This Else Show This
本文介绍了如果此页显示此其他显示此的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在除联系页面之外的所有页面上,我希望它在inc-header.php include中显示以下内容。
On all pages apart from the contact page, I want it to show the following in the inc-header.php include.
<p><a href="contact.php">Contact</a></p>
在页面 contact.php
,我希望它显示:
On the page contact.php
, I want it to show:
<p><a href="index.php">Home</a></p>
这可能是正确的吗?
推荐答案
<?php
if (stripos($_SERVER['REQUEST_URI'], 'contact.php')){
echo '<p><a href="index.php">Home</a></p>';
}
else{
echo '<p><a href="contact.php">Contact</a></p>';
}
这篇关于如果此页显示此其他显示此的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文