Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.