Page 1 of 1

echo when a link is clicked

Posted: Mon Apr 12, 2010 4:28 am
by ajay600
i get a web page as input invariable $doc and another in $doc2.
after some operations on $doc i display the web page using
echo $doc->saveHTML();
no when the output is displayed , when i click on a link in the page , i want to echo an another page "echo $doc->saveHTML();".
i am a noob in php and heard this cant be done using php and has to be done in ajax...
if this has to be done in ajax will the entire php code that i did need to be changed
or can it be done in php itself .. please help

Re: echo when a link is clicked

Posted: Mon Apr 12, 2010 4:47 am
by marty pain
Always post the page to itself, that way you can display what ever you like based on any conditions you set. AJAX is just another way of doing that, but it calls a page that only has the condition, returning the results that can be used in the current page without re-posting the whole thing.