CyberShot Posted November 15, 2009 Share Posted November 15, 2009 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 } Quote Link to comment https://forums.phpfreaks.com/topic/181643-how-to-recognize-includes/ Share on other sites More sharing options...
mikesta707 Posted November 15, 2009 Share Posted November 15, 2009 can i see the code that includes pages. if you are using GET to decide what page to include, then you could just use that same value to decide what other stuff to run Quote Link to comment https://forums.phpfreaks.com/topic/181643-how-to-recognize-includes/#findComment-958090 Share on other sites More sharing options...
CyberShot Posted November 15, 2009 Author Share Posted November 15, 2009 I am not using GET Quote Link to comment https://forums.phpfreaks.com/topic/181643-how-to-recognize-includes/#findComment-958091 Share on other sites More sharing options...
CyberShot Posted November 15, 2009 Author Share Posted November 15, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/181643-how-to-recognize-includes/#findComment-958097 Share on other sites More sharing options...
mikesta707 Posted November 15, 2009 Share Posted November 15, 2009 ahh I see, didn't know it was Javascript. since the page doesn't refresh, you won't be able to use php to change the content of sections without a page refresh. you could use javascript Quote Link to comment https://forums.phpfreaks.com/topic/181643-how-to-recognize-includes/#findComment-958101 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.