Php Function Include

Started on the old forum in June 2007 · view the original in the archive · old links redirect here

4 replies · 548 views · started 19 years ago · 1 min read

2 participants
wizard Senior · 493 posts #1

in my script i have these files.

../sources/core.php

and

../controls/admin/index.php

i do this in ../controls/admin/index.php

<?php

include("../sources/core.php");

blah blah blah

?>

when i try to access

../controls/admin/index.php

i get

Warning: include(../sources/core.php) [function.include]: failed to open stream: No such file or directory in /home/user/public_html/controls/owner/index.php on line 3

Warning: include(../sources/core.php) [function.include]: failed to open stream: No such file or directory in /home/user/public_html/controls/owner/index.php on line 3

Warning: include() [function.include]: Failed opening '../sources/core.php' for inclusion (include_path='.:/software/php/lib/php') in /home/user/public_html/controls/owner/index.php on line 3

can sum1 plz help me with this. i dnt see the problem

amylee Principal · 1,092 posts #2

try

<?php require("../sources/core.php"); blah blah blah ?>

might work might not

linkrx7 #4

having ../ in link means its lookin for file thats back 1 folder on server so ../../ would be back 2 folders etc

linkrx7 #5

ya shouldnt need all that in path though

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close