Am calling a php file in another file but am hesitating between include() and require(), which one is most recommended?
I also have to call a function from one file to the other, what is the statement for this???
The function is like: function Function1(param1, param2....paramX)
include() or require() ??
Moderator: General Moderators
Re: include() or require() ??
if you use require and there is a problem with the file you're calling, the rest of the code will not be executed. its totally up to you which one you use and it depends on how you need to use them.
again with the function, just use require() or include() and you'll be able to use that function anywhere in that page
again with the function, just use require() or include() and you'll be able to use that function anywhere in that page
Re: include() or require() ??
u knw the code to call the function found in one script to another script?dave1909 wrote:if you use require and there is a problem with the file you're calling, the rest of the code will not be executed. its totally up to you which one you use and it depends on how you need to use them.
again with the function, just use require() or include() and you'll be able to use that function anywhere in that page
Re: include() or require() ??
as far as i know, by including the file with the function in, you can just use the function as if it were on the same page.
insert
include(functionpage.php);
into your header and
function Function1(param1, param2....paramX)
where you want to call the function
insert
include(functionpage.php);
into your header and
function Function1(param1, param2....paramX)
where you want to call the function
Re: include() or require() ??
thx for the help