jQuery in Action, 2nd edition
The moose likes PHP and the fly likes include page content Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Languages » PHP
Reply Bookmark "include page content" Watch "include page content" New topic
Author

include page content

egbai mmumene
Ranch Hand

Joined: Sep 18, 2012
Posts: 30
hi, i saw a tutorial snippet about including pages into a default index page. but what i dont understand is how i can get the content from the include page, as in should i call a method from that page? if so what of other pages using that same index would they use the same method name? please help really confused.
K. Tsang
Ranch Hand

Joined: Sep 13, 2007
Posts: 1222

In PHP, there is a "include" function. http://www.php.net/manual/en/function.include.php

Once a php page is included, you can access the variables and methods in that page. When using include, you should also want to know about "require" function.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD
egbai mmumene
Ranch Hand

Joined: Sep 18, 2012
Posts: 30
then how do i display the content of the included file. is it through return methods or what.
K. Tsang
Ranch Hand

Joined: Sep 13, 2007
Posts: 1222

egbai mmumene wrote:then how do i display the content of the included file. is it through return methods or what.


The link provided shows some examples. Please check it out first. Basically once a page is include, those methods and variables become local (on the same page).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: include page content
 
Similar Threads
Stream and writer
what are the total ways to include?
include - directive and action
JSP to HTML on serverside
Include files when pressing links