Jump to content

display page , when a link is clicked


ajay600

Recommended Posts

Consider i have given 3 web pages as input

$doc->loadHTMLFile('http://www.a.net/page_a.htm');

$doc3->loadHTMLFile('http://www.a.net/page_b.htm');

$doc2->loadHTMLFile('http://www.a.net/page_c.htm');

 

i have the code to remove the contents that are commonly repeated in all the 3 pages.. so now after removing same contents in page 1 ,  2  and 3

finally  when i want to display the output i did

 

echo $doc->saveHTML();

echo $doc2->saveHTML();

echo $doc3->saveHTML();

 

and it  displayed all the 3 web pages one below the other

 

but i want to display the first page alone ( echo $doc->saveHTML() )

and when i click on a link that is present  in page 1 , i have to display the second page(echo $doc2->saveHTML()) and when i  click on another link available  in page 1  i have to display the third page(echo $doc3->saveHTML())

 

how can it be done using php

Link to comment
https://forums.phpfreaks.com/topic/196955-display-page-when-a-link-is-clicked/
Share on other sites

Seeing how PHP works, you will need to use AJAX for this.  PHP processes the source file, and outputs the data that is requested, then it's done.  It does not pause for client-side inputs.  Might want to go to the AJAX section to learn how to make those kinds of calls.

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.