Jump to content

[SOLVED] can you do


Scott87

Recommended Posts

the *insert thing*?

 

 

Just kidding ;)

 

 

I'm having a bit of a struggle coming up with a solution - it's probably a simple thing and i'm just totally useless and should know better but basically this is it:

 

 

I've got a site which is ran through a CMS, the CMS generates pages from the index.php template. I want to change a few things on some pages. E.g. I have a right 'Facts box' on the index.php (which obviously displays on every page due to the template). However on the contact page I want an image to display here in place of the facts box.

 

Any ideas?

 

Thanks in advance..... ;)

 

 

Link to comment
https://forums.phpfreaks.com/topic/144054-solved-can-you-do/
Share on other sites

At the moment i'm doing it by saying :

 


<?php if($page == 'contact-us'){ include('_inc/rightsection2.inc.php'); } ?>

<?php if($page == 'login'){ include('_inc/rightsection2.inc.php'); } ?>

<?php if($page == 'faqs'){ include('_inc/rightsection2.inc.php'); } ?>


<?php include('_inc/rightsection.inc.php') ?>

 

In rightsection2.inc.php I have an include along with some other xhtml stuff. The include is to rightbox.inc.php which has:

 


<?php
$rightbox = array(
  'faqs' => '_img/faqanswers.jpg',
  'contact-us' => '_img/contactsuccessful.jpg',
  'login' => '_img/loginexperience.jpg',
);

$page = isset($_GET['page']) ? $_GET['page'] : 'home'; // default to home page
echo "<img src=\"{$rightbox[$page]}\" />";
?>

 

The images are working fine, however i still have the normal include of:

 


<?php include('_inc/rightsection.inc.php') ?>

 

Being displayed, I need to show it on all pages except the contact-us - faqs and login area. If i can hide this include only on those three pages everything should work fine.

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/144054-solved-can-you-do/#findComment-755855
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.