skip to Main Content

I use php file with my output function, ie do_header and do_body etc.

In the body function I have three div tags, div 1, div 2, div 3. div 1 holding the other two position on the left and right of the div tag 1.

I have set up some links in div 2 to open a further page from the website to collect information from user.

Rather than open a complete new webpage I want the page to open in div 3 with div 1 and div 2 remaining the same.

I have looked to try and find if this is possible but not found anything, can someone point me in the correct direction of where i can get info on this.

The html header info is held in a php function not part of the function that provides the information for the div tags 1,2 and 3.

2

Answers


  1. You can use an iframe to open the page in the div. I’ll write a minimal code to help you in the correct direction.

    Put an iframe html inside your div-3:

    <div>
      <iframe id='div3_iframe' width="500" height="350">
    <div>
    

    Add an onclick event listener to your button/link which will add source to your iframe.

    <button onclick='document.getElementById("div3_iframe").src="div_3.php";' />
    
    Login or Signup to reply.
  2. Have you tried iframe? You can check this iframe example. Especially Iframe – Target for a Link section of the page.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search