function from another page?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
hi guys i was just wondering can i call a function from another page
and get the return value?
like if i had page1.php which have the function fun1() can i call this
function from another page ?? if i can how?? many thanx in advance :)...

Re: function from another page? wrote:

Quoted text here. Click to load it

Yes and no.

No, you cannot call a PHP function directly on another page.
You could however call another URI (could be PHP) and catch the complete  
output of that script.
But why makes things so difficult?

Yes: If you modify your setup a little:
Why not put the function(s) in a seperate file, and include that file  
whereever you need it?

Erwin Moller

Re: function from another page?

i already thought of putting the functions in a seprate file but i had
this idea of putting every page in a certain type like (news - links
..etc) and i wanted to make a super class that everyone can inherit and
this super class have a function that return the type .... i hope i
made it clear and thanx again man...

Site Timeline