开发者

External link to php page for global function? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

I want to create a file which contains global functions and variables that all the other pages (Html and PHP) could c开发者_高级运维all for. I'm struggling in coding on index.php at the moment, when it comes to the copyright, I've got the php function which could show the system's year, that I don't want to put this code on the top of the page as I want to put them on a separate file/sheet and have index.php to call for it.

Also I don't want to write the same copyright line on every single page I will create. Where and how could I put this content on and have it called from another files?


not real clear on your q. but .. is http://php.net/manual/en/function.include-once.php and its ilk what you want


I'm not 100% sure what you mean, but you can include other PHP files by using either include() or require(), they do the same thing but require() causes the page to die if it fails.

syntax:

<?php

include("path/to/file.php);

?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜