Jump to content

open php file inside the <div> tag?


sayedsohail

Recommended Posts

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>";


?>

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/65815-open-php-file-inside-the-tag/
Share on other sites

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

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.