echo when a link is clicked

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ajay600
Forum Newbie
Posts: 14
Joined: Tue Jan 19, 2010 8:54 am

echo when a link is clicked

Post 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
marty pain
Forum Contributor
Posts: 105
Joined: Thu Jun 11, 2009 5:32 am
Location: Essex

Re: echo when a link is clicked

Post 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.
Post Reply