/    Sign up×
Community /Pin to ProfileBookmark

PHP Includes

I am having trouble with PHP Includes. For some reason they wont work. I’ve tried different tuts but none seem to work or i just don’t get it. Can anyone help me?

they’re suppose to be easy.. no? lol

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NevermoreMay 25.2003 — What exactly are you trying to do? To include a file, just rename the page to .php and put this code in it: <?php include("FileToInclude.whatever"); ?>. The file you want to include can have any extension.
Copy linkTweet thisAlerts:
@krysauthorMay 25.2003 — im trying to include a menu to my pages... so when I update it, I dont have to edit every page.
Copy linkTweet thisAlerts:
@NevermoreMay 26.2003 — OK. here's how to do it:

1) Put this code in the page you want to include the menu in:
[code=php]include_once("pagetoinclude.htm")[/code]
(Changing the filename in the parantheses)

2)Put the menu in the same directory as the file it's being included in.

3)See if it works - note that it will have to be run on a PHP-enabled server to work.

4)Post again if it doesn't!
Copy linkTweet thisAlerts:
@krysauthorMay 26.2003 — It worked. Thanks :]
×

Success!

Help @krys spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...