I have a php file, for example abc.php file whose output will be an image(profile pic) and below it a set of links(navigation links). When i click any of those links, it displays the output of destination file(output of file mentioned in "href" attribute of anchor tag). But i want the contents of this file abc.php also to be shown. In short, whichever link i click, i want abc.php also to be shown along with the output of the destination file. ie.. my navigation column should stay constant.

I used php's include function but didn't get the desired results. include() can be used only if the file we want to include is continous with the file in which we want to include it. but my abc.php file is a complete php file(also contains html coding) and so cannot use it. can anyone help me? thanx in advance.

Recommended Answers

All 2 Replies

im not sure i understand what you mean

k. let me put it this way. I want to display a particular file's output in every other file. A simple answer will be to use php's include() function. Suppose i want to include file abc.php in file xyz.php, then i would use include('abc.php'); in that portion of xyz.php where i want the output of abc.php to appear.

So, abc.php shud not contain any variables used in xyz.php. Also if abc.php contains <html> and <body>, then </html> and </body> shud be present only in xyz.php. That is abc.php shud appear as if its continous with xyz.php.

But in my case, abc.php and xyz.php are both complete php files and both include <html> and </html>. I want the output of abc.php to be placed in a particular portion of xyz.php. Understood now??

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.