PHP Classes

Include file - linked to other file

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  Include file - linked to other file  
Subject:Include file - linked to other file
Summary:always when changing the second div visibility it includes also
Messages:2
Author:junk
Date:2010-01-25 08:44:30
Update:2010-02-01 10:57:24
 

  1. Include file - linked to other file   Reply   Report abuse  
Picture of junk junk - 2010-01-25 14:34:00
I have this problem which I really don't know how to solve… it's really wired and I've tried so many ways then I thought that a different view might reveal something I didn't notice.
So…
I have six divs in my php page with display style = none, except the first div which is visible. I have buttons which their onclick event change the display of the divs, i.e. make one div visible and the others invisible. It works like magic except for the second div where it also includes the php file from the third div.
Of course that snap code is always better than words:
<div id="1" style="width: 950px; display: block">
<?php include('file1.php'); ?>
</div>

<div id="2" style="width: 950px; display: none">
<?php include('file2.php'); ?>
</div>

<div id="3" style="width: 950px; display: none">
<?php include('file3.php'); ?>
</div>
<div id="4" style="width: 950px; display: block">
<?php include('file4.php'); ?>
</div>

<div id="5" style="width: 950px; display: none">
<?php include('file5.php'); ?>
</div>

<div id="6" style="width: 950px; display: none">
<?php include('file6.php'); ?>
</div>


And this is the code for the onclick event:
<a href="javascript:void(0);" onclick="includefile(1); return false;" > <img name="child" border="0" src="images/child.gif" width="180" height="30" /></a>

There are six buttons like this one with different gifs and each button include different file.


I tried many things – change the order, replace the included files, create new files, etc. but the bug still remains: always when changing the second div visibility it includes also the file in the div below it (I checked the display style of the third div and it remains none – it's just the third file is included under the second div).

Sorry for the long story – I wanted to be clear and I believe that knowing all the details may help for having some ideas.

Thank you for any advice!!

There is 1 reply in this thread, which is not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.