unsider Posted July 27, 2008 Share Posted July 27, 2008 ok I have a file "extern.php" in: root/one/two/extern.php directory that I've tried calling in: root/one/index.php with the two most basic methods: <?php include("../two/extern.php?action=active"); include("two/extern.php?action=active"); ?> The file exists, the action exists, and my don't worry my $_GET arrays are sanatized, but it throws this error: include(../two/extern.php?action=active) [function.include]: failed to open stream: No such file or directory. What's frustrating about this is, it's not only one of the most basic things, this is the only include, or very many that is throwing this error. Thanks. If you need any more information let me know. Argh. EDIT: caught my mistake, changed up the dir names, two = forum. Sorry about that Quote Link to comment https://forums.phpfreaks.com/topic/116878-includesimple-error-why/ Share on other sites More sharing options...
Nhoj Posted July 27, 2008 Share Posted July 27, 2008 Neither of the two include commands you listed include a file in the ../forum folder. What are the contents of the forum folder, where is it located and the file that includes forum/extern.php is it the same /root/one/two/extern.php file? Quote Link to comment https://forums.phpfreaks.com/topic/116878-includesimple-error-why/#findComment-601015 Share on other sites More sharing options...
unkwntech Posted July 27, 2008 Share Posted July 27, 2008 To add to that .. means to go up one directory so if root/one/index.php trys to include ../two/file.php that means root/two/ instead just use two/file.php Quote Link to comment https://forums.phpfreaks.com/topic/116878-includesimple-error-why/#findComment-601019 Share on other sites More sharing options...
KevinM1 Posted July 27, 2008 Share Posted July 27, 2008 In order to send query strings, you need to use the full path of the file (see example 3): http://www.php.net/manual/en/function.include.php Quote Link to comment https://forums.phpfreaks.com/topic/116878-includesimple-error-why/#findComment-601021 Share on other sites More sharing options...
unsider Posted July 27, 2008 Author Share Posted July 27, 2008 To add to that .. means to go up one directory so if root/one/index.php trys to include ../two/file.php that means root/two/ instead just use two/file.php @NHoj, I fixed my mistake, you can take another look if you'd like. @unkwn I've tried using "two/extern.php", that was the most logical, and first thing I thought of, but unfortunately it still returns the error. Quote Link to comment https://forums.phpfreaks.com/topic/116878-includesimple-error-why/#findComment-601027 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.