sayedsohail Posted August 20, 2007 Share Posted August 20, 2007 Hi everyone, In my main.php file, I have got two tabs and i wish to open the related files i.e, details.php when i click the details tab and notes.php when i click the notes tab. Unfortunately when i click any of the tabs the file taking up the entire space of the window. I want keep the tabs and display the file below the tabs menu. I knew i can achieve this using iframe, but is there any way i can achieve the same using div elements. main.php <? echo "<html><head><title>Main</title></head>"; echo "<li><a href='details.php' onclick=\"show('sub1'); return(false);\"> <span >Details</span></a> </li><li><a href='notes.php' onclick=\"show('sub2'); return (false);\"> <span>Notes</span></a></li> </ul>"; echo "<div id='sub1'></div><div id='sub2'></div></html>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/65815-open-php-file-inside-the-tag/ Share on other sites More sharing options...
adam84 Posted August 20, 2007 Share Posted August 20, 2007 1. you can use ajax to load the details or note pages into the div/span tag. 2. use a form, so that when the user clicks a tab, the page refreshes and you can then see which variable isset and load the corresponding page into the div/span tag Quote Link to comment https://forums.phpfreaks.com/topic/65815-open-php-file-inside-the-tag/#findComment-329281 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.