This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes PHP and the fly likes include page content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Languages » PHP
Bookmark "include page content" Watch "include page content" New topic
Author

include page content

egbai mmumene
Ranch Hand

Joined: Sep 18, 2012
Posts: 43
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
Bartender

Joined: Sep 13, 2007
Posts: 1977
    
    7

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 OCPJP7
egbai mmumene
Ranch Hand

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

Joined: Sep 13, 2007
Posts: 1977
    
    7

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
what are the total ways to include?
include - directive and action
Include files when pressing links
Stream and writer
JSP to HTML on serverside