/    Sign up×
Community /Pin to ProfileBookmark

Problem with include tag in head…

I’m trying to insert a Javascript in the HEAD of my page by using includes…

[CODE]<?php include(‘/includes/banner_scrolling/aa-main.php’); ?>[/CODE]

The path is correct, I’ve double and triple checked that… But here’s what I get:

[CODE]Warning: main(/includes/banner_scrolling/aa-main.php) [function.main]: failed to open stream: No such file or directory in /home/user/public_html/index.php on line 93

Warning: main(/includes/banner_scrolling/aa-main.php) [function.main]: failed to open stream: No such file or directory in /home/user/public_html/index.php on line 93

Warning: main() [function.include]: Failed opening ‘/includes/banner_scrolling/aa-main.php’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/user/public_html/index.php on line 93[/CODE]

The file to be included (aa-main.php) has ONLY the Javascript as it normally appears in the head, with the script tags and all.

Any idea why it’s not reading the file, and inserting it between the head tags where I put the include?

Thanks in advance for your assistance. ?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogDec 29.2007 — include() is looking for a filesystem path, not a web path, so you'll need to do something like:
[code=php]
include $_SERVER['DOCUMENT_ROOT'] . '/includes/banner_scrolling/aa-main.php';
[/code]
Copy linkTweet thisAlerts:
@KitelifeauthorDec 29.2007 — Perfect, thanks!

It's a scrolling banner script, and it's appearing now, but not scrolling... I've gone back to the original thread where we put it together with Mr J.
×

Success!

Help @Kitelife 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...