Jump to content

how to recognize includes?


CyberShot

Recommended Posts

I am putting together a site. I have three sections on the site. A top section and a middle section and bottom section(footer)

 

the top section has a slider that is part of the navigation. When you push about, instead of loading the about page, it loads the about.php as an include into that slider area. What I would like to know is if it is possible to write code that will recognize the fact that the about.php was included and then run different code for the middle section based on that. So if about.php was loaded, run this include else, run regular xhtml. I don't know how to write this code. I tried something like

 

if(include() == "about.php")

{

  do something

}

Link to comment
https://forums.phpfreaks.com/topic/181643-how-to-recognize-includes/
Share on other sites

I just typed out a long reply and lost it. Let me try again.

 

the slider is this one

 

http://jqueryfordesigners.com/demo/coda-slider.html

 

the code is arranged like this

 

<div class="panel" id="blog">
     <h2>Blog</h2>
   	  	<?php include('blog.php'); ?>
    </div><!--END BLOG PANEL-->
    <div class="panel" id="services">
     
     	<?php include('services.php'); ?>
    </div><!--END SERVICES PANEL-->
    <div class="panel" id="testimonials">
     <h2>Testimonials</h2>
     	<?php include('testimonials.php'); ?>
    </div><!--END TESTIMONIALS PANEL-->
    <div class="panel" id="order">
     <h2>Order</h2>
    	<?php include('order.php'); ?>
    </div><!--END ORDER PANEL-->
    <div class="panel" id="contact">
     	<?php include('contact.php'); ?>
    </div><!--END CONTACT PANEL-->

 

the idea is that when you push the button, the slider slides and loads the include. I want to be able to change the content of the sections below based on what include was loaded. Otherwise the page will be static. I am using includes to load the slider panels so that the code in the index page stays much cleaner.

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.